@media screen and (max-width: 1024px) {
  .raspored-matrix-header {
    grid-template-columns: 1fr;
    gap: var(--spacing-md);
  }

  .raspored-matrix-header__center {
    text-align: left;
  }

  .raspored-matrix-header__right {
    align-items: flex-start;
  }

  .raspored-matrix-header__mode-selector {
    justify-content: flex-start;
  }
}

@media screen and (max-width: 768px) {
  .raspored-archive__container {
    padding: var(--spacing-sm);
  }

  .raspored-archive__header,
  .raspored-matrix,
  .raspored-daily-matrix {
    padding: var(--spacing-md);
    border-radius: var(--radius-md);
  }

  .raspored-matrix-header__title {
    font-size: var(--fs-h4);
  }

  .raspored-matrix-header__mode-selector {
    display: grid;
    grid-template-columns: 1fr;
    width: 100%;
  }

  .raspored-matrix-header__print-button {
    width: 100%;
  }

  .raspored-active-view {
    display: block;
  }

  .raspored-active-view h2 {
    margin-bottom: var(--spacing-xs);
  }
}

/* =========================================================
   SCREEN POLISH KOREKCIJA — DNEVNI OVERFLOW I PRINT DUGME
   ========================================================= */

@media screen {
  body.print-odeljenja_dani .raspored-daily-matrix,
  body.print-profesori_dani .raspored-daily-matrix,
  body.print-kabineti_dani .raspored-daily-matrix {
    width: 100% !important;
    max-width: 100% !important;
    overflow-x: auto !important;
    overflow-y: hidden !important;
  }

  body.print-odeljenja_dani .raspored-daily-matrix__table,
  body.print-profesori_dani .raspored-daily-matrix__table,
  body.print-kabineti_dani .raspored-daily-matrix__table {
    width: 100% !important;
    min-width: 760px !important;
    max-width: none !important;
    table-layout: fixed !important;
  }

  .raspored-archive .raspored-matrix-header__print-button,
  .raspored-archive button.raspored-matrix-header__print-button {
    background: var(--color-primary) !important;
    color: var(--color-white) !important;
    border-color: var(--color-primary) !important;
    box-shadow: var(--shadow-pagination-link) !important;
  }

  .raspored-archive .raspored-matrix-header__print-button:hover,
  .raspored-archive .raspored-matrix-header__print-button:focus,
  .raspored-archive button.raspored-matrix-header__print-button:hover,
  .raspored-archive button.raspored-matrix-header__print-button:focus {
    background: var(--color-accent) !important;
    color: var(--color-white) !important;
    border-color: var(--color-accent) !important;
    box-shadow: var(--shadow-button-hover) !important;
  }
}

/* =========================================================
   SCREEN POLISH MIKRO-KOREKCIJA — ODELJENJA DANI PAGE OVERFLOW
   ========================================================= */

@media screen {
  body.print-odeljenja_dani {
    max-width: 100% !important;
    overflow-x: hidden !important;
  }

  body.print-odeljenja_dani .raspored-archive,
  body.print-odeljenja_dani .raspored-archive__container {
    width: 100% !important;
    max-width: 100% !important;
    min-width: 0 !important;
    box-sizing: border-box !important;
    overflow-x: hidden !important;
  }

  body.print-odeljenja_dani .raspored-daily-matrix {
    width: 100% !important;
    max-width: 100% !important;
    min-width: 0 !important;
    box-sizing: border-box !important;
    overflow-x: auto !important;
    overflow-y: hidden !important;
  }

  body.print-odeljenja_dani .raspored-daily-matrix__table {
    width: 100% !important;
    min-width: 760px !important;
    max-width: none !important;
    table-layout: fixed !important;
  }
}

/* =========================================================
   SCREEN POLISH MIKRO-KOREKCIJA — SAKRIJ PRINT-ONLY DAILY NA SCREEN-U
   ========================================================= */

@media screen {
  body.print-odeljenja_dani .raspored-print-only-daily,
  body.print-odeljenja_dani .raspored-print-day,
  body.print-odeljenja_dani .raspored-print-day__table,
  body.print-kabineti_dani .raspored-print-only-daily,
  body.print-kabineti_dani .raspored-print-day,
  body.print-kabineti_dani .raspored-print-day__table {
    display: none !important;
  }
}

/* =========================================================
   USKA CSS KOREKCIJA — DAILY MATRIX SCREEN OVERFLOW
   Scope: only screen daily modes
   ========================================================= */

@media screen {
  body.print-profesori_dani .raspored-daily-matrix,
  body.print-odeljenja_dani .raspored-daily-matrix,
  body.print-kabineti_dani .raspored-daily-matrix {
    width: 100%;
    max-width: 100%;
    overflow-x: auto;
    overflow-y: hidden;
  }

  body.print-profesori_dani .raspored-daily-matrix__scroll,
  body.print-odeljenja_dani .raspored-daily-matrix__scroll,
  body.print-kabineti_dani .raspored-daily-matrix__scroll {
    width: 100%;
    max-width: 100%;
    overflow-x: auto;
    overflow-y: hidden;
  }

  body.print-profesori_dani .raspored-daily-matrix__table,
  body.print-odeljenja_dani .raspored-daily-matrix__table,
  body.print-kabineti_dani .raspored-daily-matrix__table {
    width: max-content;
    max-width: none;
  }
}

/* =========================================================
   USKA CSS KOREKCIJA R2 — DAILY BLOCK SCREEN OVERFLOW
   Scope: only screen daily modes
   Reason: actual table parent is .raspored-daily-block
   ========================================================= */

@media screen {
  body.print-profesori_dani .raspored-daily-block,
  body.print-odeljenja_dani .raspored-daily-block,
  body.print-kabineti_dani .raspored-daily-block {
    width: 100%;
    max-width: 100%;
    min-width: 0;
    box-sizing: border-box;
    overflow-x: auto;
    overflow-y: hidden;
  }

  body.print-profesori_dani
    .raspored-daily-block
    > .raspored-daily-matrix__table,
  body.print-odeljenja_dani
    .raspored-daily-block
    > .raspored-daily-matrix__table,
  body.print-kabineti_dani
    .raspored-daily-block
    > .raspored-daily-matrix__table {
    width: max-content;
    max-width: none;
    min-width: 760px;
  }
}
/* D82 B5 + B9: navigation and readable matrix cells, for screen only. */
@media screen{
 .d82b-public-nav{display:flex;flex-wrap:wrap;align-items:center;gap:8px;padding:10px clamp(14px,2vw,32px);width:100%;max-width:none;box-sizing:border-box;background:#ecf3fa;border-bottom:1px solid #cdddeb}
 .d82b-public-nav a{display:inline-flex;align-items:center;min-height:44px;padding:8px 12px;border-radius:8px;color:#123b65;text-decoration:none;font-weight:700;white-space:normal}
 .d82b-public-nav a[aria-current="page"]{font-weight:700}
 .raspored-matrix__scroll,.raspored-daily-block,.raspored-daily-matrix__scroll{overflow-x:auto;max-width:100%}
 .raspored-matrix__table,.raspored-daily-matrix__table{width:max-content!important;min-width:100%;max-width:none!important;table-layout:auto!important}
 .raspored-matrix__table th,.raspored-matrix__table td,.raspored-daily-matrix__table th,.raspored-daily-matrix__table td{overflow:visible!important;word-break:normal!important;white-space:nowrap!important;width:auto!important;max-width:none!important}
 .raspored-matrix__table th:first-child,.raspored-matrix__table td:first-child,.raspored-daily-matrix__table th:first-child,.raspored-daily-matrix__table td:first-child{min-width:2.4rem!important}
 .raspored-matrix__table th:nth-child(2),.raspored-matrix__table td:nth-child(2),.raspored-daily-matrix__table th:nth-child(2),.raspored-daily-matrix__table td:nth-child(2){min-width:max-content!important}
}

/* D82-B BL-1: daily tables must size name cells intrinsically; scroll only within the daily block.
   Override the older, more specific fixed-layout screen rules without affecting print. */
@media screen {
  body.print-profesori_dani .raspored-daily-block > .raspored-daily-matrix__table,
  body.print-odeljenja_dani .raspored-daily-block > .raspored-daily-matrix__table,
  body.print-kabineti_dani .raspored-daily-block > .raspored-daily-matrix__table {
    table-layout: auto !important;
    width: max-content !important;
    min-width: max(100%, 760px) !important;
    max-width: none !important;
  }
}

/* D83-B: task-oriented toolbar outside #primary; the six matrices and print markup are retained. */
@media screen {
 .d83-public-tools{display:grid;grid-template-columns:minmax(190px,.8fr) minmax(400px,2fr);gap:12px 24px;margin:12px auto 8px;max-width:1500px;padding:15px clamp(14px,3vw,28px);border:1px solid #c9d9e8;border-left:5px solid #1e5fa8;border-radius:14px;background:#fff;box-shadow:0 6px 24px rgba(24,57,92,.06)}
 .d83-public-tools__identity{min-width:0}.d83-public-tools__identity h2{font:700 clamp(18px,2.3vw,25px)/1.25 var(--font-body);color:#163c66;margin:3px 0 7px}.d83-public-tools__identity p{margin:0;color:#4d6073;font:14px/1.4 system-ui,Arial,sans-serif}
 .d83-public-tools__identity .d83-public-tools__eyebrow{font:700 11px/1.3 system-ui,Arial,sans-serif;letter-spacing:.12em;text-transform:uppercase;color:#487cae}
 .d83-public-tools__actions{display:grid;grid-template-columns:repeat(2,minmax(0,1fr)) auto auto;align-items:end;gap:9px}
 .d83-public-tools__actions label{min-width:0;display:grid;gap:4px;font:600 12px/1.4 system-ui,Arial,sans-serif;color:#234b73}
 .d83-public-tools__actions select,.d83-public-tools__actions input{height:39px;width:100%;min-width:0;border:1px solid #a8bfd4;border-radius:7px;padding:7px 9px;background:#fff;color:#152c44;font:14px system-ui,Arial,sans-serif}
 .d83-public-tools__actions button{height:39px;border:1px solid #23629d;background:#edf5fc;color:#1d5587;border-radius:7px;padding:5px 10px;font:600 12px system-ui,Arial,sans-serif;cursor:pointer}
 .d83-public-tools__actions button:last-child{background:#1e5fa8;color:#fff}
 .d83-public-tools__foot{grid-column:1/-1;display:flex;gap:8px;flex-wrap:wrap;align-items:center;font:12px/1.5 system-ui,Arial,sans-serif;color:#51677c}
 .d83-public-filter-chip{border-radius:100px;background:#e3effa;color:#154775;padding:4px 8px}
 .d83-public-tools a{color:#1d5b97;font-weight:600}
 .raspored-archive__container{padding:12px clamp(10px,2vw,22px)}
 .raspored-archive__header{padding:clamp(12px,2vw,18px);margin-bottom:12px;box-shadow:none;border-radius:12px}
 .raspored-matrix-header__title{font-size:clamp(20px,2.5vw,30px)}
 .raspored-matrix__scroll tbody tr[hidden],.raspored-daily-matrix__table tbody tr[hidden]{display:none!important}
 .d83-public-tools button:focus-visible,.d83-public-tools input:focus-visible,.d83-public-tools select:focus-visible{outline:3px solid #f9b44d;outline-offset:2px}
}
@media screen and (max-width:1000px){.d83-public-tools{grid-template-columns:1fr}.d83-public-tools__actions{grid-template-columns:repeat(2,minmax(0,1fr)) auto auto}}
@media screen and (max-width:620px){.d83-public-tools{margin:8px;padding:12px}.d83-public-tools__actions{grid-template-columns:repeat(2,minmax(0,1fr))}.d83-public-tools__actions label{grid-column:1/-1}.d83-public-tools__actions button{min-height:39px}.raspored-archive__header{padding:10px}}
@media print{.d83-public-tools{display:none!important}}

/* D21-R6: single public toolbar; intrinsic matrix cells stay inside their own scroller. */
@media screen {
  .d83-public-tools__actions {
    grid-template-columns: minmax(190px, .8fr) minmax(260px, 2fr) auto auto;
    align-items: end;
  }
  .d83-public-tools__actions button {
    width: auto;
    height: 44px;
    min-height: 44px;
    white-space: nowrap;
    font-size: 14px;
  }
  .d83-public-tools__actions select,
  .d83-public-tools__actions input { height:44px; font:14px var(--font-body); }
  .d83-public-tools__filter-panel[hidden] { display:none !important; }
  .d83-public-tools__filter-panel:not([hidden]) { grid-column:1/-1; min-width:0; }
  .d83-public-tools__filter-panel .raspored-classroom-filters {
    position:static;
    width:100%;
    max-height:none;
    grid-template-columns:repeat(4,minmax(0,1fr));
    box-shadow:none;
  }
  .raspored-matrix-header {
    grid-template-columns:minmax(0,1fr) minmax(0,1.2fr) minmax(0,1fr);
    align-items:center;
  }
  .raspored-matrix-header__left { grid-column:1; }
  .raspored-matrix-header__center { grid-column:2; text-align:center; }
  .raspored-matrix-header__right { grid-column:3; align-items:flex-end; }
  body:is(.print-odeljenja_zbirno,.print-profesori_zbirno,.print-kabineti_zbirno) .raspored-matrix__scroll {
    width:100%; max-width:100%; min-width:0; overflow-x:auto; overflow-y:hidden;
  }
  body:is(.print-odeljenja_zbirno,.print-profesori_zbirno,.print-kabineti_zbirno) .raspored-matrix__table {
    width:max-content !important; min-width:100% !important; max-width:none !important; table-layout:auto !important;
  }
  body:is(.print-odeljenja_zbirno,.print-profesori_zbirno,.print-kabineti_zbirno) .raspored-matrix__table tbody td:nth-child(n + 3) {
    width:auto !important; min-width:max-content; max-width:none !important;
    overflow:visible !important; white-space:nowrap !important;
  }
  body:is(.print-odeljenja_zbirno,.print-profesori_zbirno,.print-kabineti_zbirno) .raspored-matrix-cell__lesson {
    display:inline-block; min-width:max-content; font-size:12px; line-height:1.25; white-space:nowrap; overflow:visible;
  }
  .raspored-subject-legend { margin:16px 0; padding:12px 16px; color:#334155; background:#f6f8fb; border:1px solid #d7e1eb; border-radius:8px; font:13px/1.45 var(--font-body); }
  .raspored-subject-legend ul { display:flex; flex-wrap:wrap; gap:6px 18px; list-style:none; margin:8px 0 0; padding:0; }
  .raspored-subject-legend li { display:flex; gap:6px; }
  .raspored-subject-legend li span:first-child { color:#174f82; font-weight:700; white-space:nowrap; }
}
@media screen and (max-width:1000px) {
  .d83-public-tools__actions { grid-template-columns:minmax(180px,.8fr) minmax(0,2fr) auto auto; }
}
@media screen and (max-width:640px) {
  .d83-public-tools__actions { display:flex; flex-direction:column; align-items:stretch; gap:10px; }
  .d83-public-tools__actions > label,
  .d83-public-tools__actions > button { width:100%; box-sizing:border-box; }
  .d83-public-tools__actions button { min-height:44px; }
  .d83-public-tools__filter-panel .raspored-classroom-filters { grid-template-columns:1fr; }
  .raspored-matrix-header { grid-template-columns:minmax(0,1fr); }
  .raspored-matrix-header__left,
  .raspored-matrix-header__center,
  .raspored-matrix-header__right { grid-column:1; text-align:left; align-items:stretch; }
  .raspored-matrix-header__print-button { width:100%; min-height:44px; }
}

/* Završna pravila posle ranijih istorijskih pravila za agregatne matrice. */
@media screen {
  body:is(.print-odeljenja_zbirno,.print-profesori_zbirno,.print-kabineti_zbirno) .raspored-matrix__scroll { width:100%; max-width:100%; min-width:0; overflow-x:auto; overflow-y:hidden; }
  body:is(.print-odeljenja_zbirno,.print-profesori_zbirno,.print-kabineti_zbirno) .raspored-matrix__table { width:max-content !important; min-width:100% !important; max-width:none !important; table-layout:auto !important; }
  body:is(.print-odeljenja_zbirno,.print-profesori_zbirno,.print-kabineti_zbirno) .raspored-matrix__table tbody td:nth-child(n + 3) { width:auto !important; min-width:max-content !important; max-width:none !important; overflow:visible !important; white-space:nowrap !important; }
  body:is(.print-odeljenja_zbirno,.print-profesori_zbirno,.print-kabineti_zbirno) .raspored-matrix-cell__lesson { display:inline-block; min-width:max-content; font-size:12px; white-space:nowrap; overflow:visible; }
}

/* N133-R2 — public timetable only: remove navigation and controls from every
   printed view/page while preserving school identity and timetable matrices.
   Screen styling is deliberately unchanged. */
@media print {
  body[data-public-timetable-view] > nav.d82b-public-nav,
  body[data-public-timetable-view] > .d83-public-tools,
  body[data-public-timetable-view] .raspored-matrix-header__right,
  body[data-public-timetable-view] .raspored-matrix-header__mode-selector,
  body[data-public-timetable-view] .raspored-filter-panel,
  body[data-public-timetable-view] .raspored-classroom-filters,
  body[data-public-timetable-view] .raspored-matrix-header__print-button,
  body[data-public-timetable-view] .raspored-archive form,
  body[data-public-timetable-view] .raspored-archive button,
  body[data-public-timetable-view] .raspored-archive input,
  body[data-public-timetable-view] .raspored-archive select,
  body[data-public-timetable-view] .raspored-archive textarea,
  body[data-public-timetable-view] .raspored-archive .raspored-active-view {
    display: none !important;
  }
}

/* Keep the first daily-class table beside its print heading instead of
   producing a header-only page when the daily table spans multiple pages. */
@media print {
  body.print-odeljenja_dani .raspored-print-day {
    break-inside: auto !important;
    page-break-inside: auto !important;
  }
}


/* N137 TEST 78: public timetable controls and desktop matrix geometry.
   Screen-only, scoped to the existing timetable view; print is unchanged. */
@media screen {
  body[data-public-timetable-view] > nav.d82b-public-nav {
    align-items: center;
    gap: 8px;
    padding: 10px clamp(14px, 2vw, 32px);
    width: 100%;
    max-width: none;
    box-sizing: border-box;
    background: #ecf3fa;
    border-bottom: 1px solid #cdddeb;
  }
  body[data-public-timetable-view] > nav.d82b-public-nav a {
    display: inline-flex;
    align-items: center;
    min-height: 44px;
    padding: 8px 12px;
    border: 0;
    border-radius: 8px;
    color: #123b65;
    font-weight: 700;
    text-decoration: none;
    transition: background-color .15s ease, color .15s ease, border-color .15s ease;
  }
  body[data-public-timetable-view] > nav.d82b-public-nav a:hover,
  body[data-public-timetable-view] > nav.d82b-public-nav a:focus-visible {
    background: #174f82;
    border-color: #174f82;
    color: #fff;
    text-decoration: none;
  }
  body[data-public-timetable-view] > nav.d82b-public-nav a:focus-visible,
  body[data-public-timetable-view] .d83-public-tools__foot > a[href="/raspored-casova/"]:focus-visible {
    outline: 3px solid #154978;
    outline-offset: 2px;
  }
  body[data-public-timetable-view] > nav.d82b-public-nav a[aria-current="page"] {
    background: #194d7d;
    color: #fff;
    font-weight: 700;
  }
  body[data-public-timetable-view] .d83-public-tools__foot > a[href="/raspored-casova/"] {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 34px;
    padding: 6px 12px;
    border: 1px solid #b7cee4;
    border-radius: 8px;
    background: #eef5fc;
    color: #174f82;
    font: 700 12px/1.35 system-ui, Arial, sans-serif;
    text-decoration: none;
  }
  body[data-public-timetable-view] .d83-public-tools__foot > a[href="/raspored-casova/"]:hover,
  body[data-public-timetable-view] .d83-public-tools__foot > a[href="/raspored-casova/"]:focus-visible {
    background: #174f82;
    border-color: #174f82;
    color: #fff;
    text-decoration: none;
  }
}
@media screen and (min-width: 1580px) {
  body[data-public-timetable-view].print-odeljenja_zbirno .raspored-matrix__scroll > .raspored-matrix__table {
    width: 100% !important;
    min-width: 100% !important;
    table-layout: fixed !important;
  }
}

/* K5 verified weekly matrix: screen only; print and daily matrices unchanged. */
@media screen {
 body:is(.print-odeljenja_zbirno,.print-profesori_zbirno,.print-kabineti_zbirno) .raspored-matrix__scroll {
   width: 100%; max-width: 100%; min-width: 0; overflow-x:auto; overflow-y:hidden;
 }
 body:is(.print-odeljenja_zbirno,.print-profesori_zbirno,.print-kabineti_zbirno) .raspored-matrix__table {
   box-sizing: border-box;
   width: 100% !important;
   min-width: 1540px !important;
   max-width: none !important;
   table-layout: fixed !important;
   margin-inline: 0 !important;
 }
 body:is(.print-odeljenja_zbirno,.print-profesori_zbirno,.print-kabineti_zbirno) .raspored-matrix__table thead tr:first-child th:first-child {
   width: 42px !important;
 }
 body:is(.print-odeljenja_zbirno,.print-profesori_zbirno,.print-kabineti_zbirno) .raspored-matrix__table thead tr:first-child th:nth-child(2) {
   width: 105px !important;
 }
 body:is(.print-odeljenja_zbirno,.print-profesori_zbirno,.print-kabineti_zbirno) .raspored-matrix__table tbody td:nth-child(n + 3) {
   overflow: visible !important;
   white-space: nowrap !important;
   overflow-wrap: normal !important;
   word-break: normal !important;
   hyphens: none !important;
   padding: 3px 2px !important;
 }
}

/* TEST 2: keep daily class periods aligned across days. */
@media screen {
  body.print-odeljenja_dani .raspored-daily-block > .raspored-daily-matrix__table {
    box-sizing: border-box;
    width: 100% !important;
    table-layout: fixed !important;
  }

  body.print-odeljenja_dani .raspored-daily-block > .raspored-daily-matrix__table thead th:first-child {
    width: 2.6rem !important;
  }

  body.print-odeljenja_dani .raspored-daily-block > .raspored-daily-matrix__table thead th:nth-child(2) {
    width: 8rem !important;
  }

  body.print-odeljenja_dani .raspored-daily-block > .raspored-daily-matrix__table :is(th, td) {
    white-space: normal !important;
    overflow-wrap: anywhere !important;
  }
}

@media print {
  @page raspored-odeljenja-dani {
    size: A4 landscape;
    margin: 7mm 6mm 8mm 6mm;
  }

  body.print-odeljenja_dani {
    page: raspored-odeljenja-dani;
  }

  body.print-odeljenja_dani .raspored-print-only-daily > .raspored-print-day {
    margin: 0 0 2.5mm !important;
    break-inside: auto !important;
  }

  body.print-odeljenja_dani .raspored-print-only-daily > .raspored-print-day:not(:first-child) {
    break-before: auto !important;
  }

  body.print-odeljenja_dani .raspored-print-only-daily .raspored-print-day__title {
    margin: 0 0 1mm !important;
    padding: 0 0 0.5mm !important;
    font-size: 11pt !important;
  }

  body.print-odeljenja_dani .raspored-print-only-daily .raspored-print-day__table {
    font-size: 10pt !important;
  }

  body.print-odeljenja_dani .raspored-print-only-daily .raspored-print-day__table :is(th, td):first-child {
    width: 7.5mm !important;
  }

  body.print-odeljenja_dani .raspored-print-only-daily .raspored-print-day__table :is(th, td):nth-child(2) {
    width: 23mm !important;
  }

  body.print-odeljenja_dani .raspored-print-only-daily .raspored-print-day__table thead {
    break-inside: avoid-page !important;
    break-after: avoid-page !important;
  }

  body.print-odeljenja_dani .raspored-print-only-daily .raspored-print-day__table :is(th, td) {
    padding: 0.85mm 0.5mm !important;
    line-height: 1.2 !important;
    overflow-wrap: normal !important;
    word-break: normal !important;
    hyphens: none !important;
  }
}

/* TEST 2: daily class timetable workspace. */
@media screen {
  body.print-odeljenja_dani {
    --daily-line: #cbd7e4;
    background: #f4f7fb;
  }

  body.print-odeljenja_dani > nav.d82b-public-nav {
    align-items: center;
    gap: 8px;
    margin: 0;
    padding: 10px clamp(14px,2vw,32px);
    width: 100%;
    max-width: none;
    box-sizing: border-box;
    border: 0;
    border-bottom: 1px solid #cdddeb;
    border-radius: 0;
    background: #ecf3fa;
  }

  body.print-odeljenja_dani > nav.d82b-public-nav a {
    display: inline-flex;
    align-items: center;
    min-height: 44px;
    padding: 8px 12px;
    border: 0;
    border-radius: 8px;
    color: #123b65;
    background: transparent;
    text-decoration: none;
    font-weight: 700;
    line-height: normal;
    white-space: normal;
  }
  body.print-odeljenja_dani > nav.d82b-public-nav a[aria-current="page"] { background:#194d7d; color:#fff; box-shadow:none; }

  body.print-odeljenja_dani > .d83-public-tools {
    grid-template-columns: minmax(12rem, 0.8fr) minmax(0, 2.2fr);
    align-items: center;
    gap: 8px 18px;
    margin-block: 0;
    padding: 10px 14px;
    border: 1px solid var(--daily-line);
    border-top: 0;
    border-radius: 0 0 12px 12px;
    background: #fff;
    box-shadow: none;
  }

  body.print-odeljenja_dani .d83-public-tools__identity p {
    margin: 0;
  }

  body.print-odeljenja_dani .d83-public-tools__identity h2 {
    margin: 2px 0 3px;
    font-size: clamp(17px, 2vw, 22px);
  }

  body.print-odeljenja_dani .d83-public-tools__actions {
    grid-template-columns: minmax(0, 1fr) minmax(0, 1.2fr) auto auto;
    gap: 7px;
  }

  body.print-odeljenja_dani .d83-public-tools__actions :is(select, input, button) {
    height: auto;
    min-height: 34px;
  }

  body.print-odeljenja_dani .d83-public-tools__foot {
    gap: 6px 12px;
  }

  body.print-odeljenja_dani .d83-public-tools__foot > a[href="/raspored-casova/"] {
    min-height: 26px;
    padding: 3px 8px;
  }

  body.print-odeljenja_dani .raspored-archive__container {
    padding-block: 8px 14px;
  }

  body.print-odeljenja_dani .raspored-archive__header {
    margin-bottom: 8px;
    padding: 10px 14px;
    border: 1px solid var(--daily-line);
    border-radius: 10px;
    background: #fff;
  }

  body.print-odeljenja_dani .raspored-matrix-header {
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
    align-items: end;
    gap: 8px 16px;
  }

  body.print-odeljenja_dani .raspored-matrix-header__center {
    text-align: right;
  }

  body.print-odeljenja_dani .raspored-matrix-header__title {
    font: 700 clamp(19px, 2.4vw, 29px)/1.15 system-ui, Arial, sans-serif !important;
  }

  body.print-odeljenja_dani .raspored-matrix-header__right {
    display: grid;
    grid-column: 1 / -1;
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: start;
    gap: 8px;
    padding-top: 8px;
    border-top: 1px solid var(--daily-line);
  }

  body.print-odeljenja_dani .raspored-matrix-header__right > form {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: start;
    gap: 7px;
    width: 100%;
  }

  body.print-odeljenja_dani .raspored-matrix-header__right > form:has(.raspored-filter-panel[open]) {
    grid-template-columns: minmax(0, 1fr);
  }

  body.print-odeljenja_dani .raspored-matrix-header__right .raspored-matrix-header__mode-selector {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 4px;
    min-width: 0;
    padding: 5px;
  }

  body.print-odeljenja_dani .raspored-matrix-header__mode-selector label {
    min-width: 0;
    gap: 4px;
    padding: 4px 6px;
    font-size: 13px;
    white-space: normal;
  }

  body.print-odeljenja_dani .raspored-matrix-header__mode-selector input {
    flex: 0 0 auto;
  }

  body.print-odeljenja_dani .raspored-archive .raspored-filter-panel {
    display: block;
  }

  body.print-odeljenja_dani .raspored-archive .raspored-filter-panel[open] > .raspored-classroom-filters {
    position: static;
    grid-template-columns: repeat(auto-fit, minmax(min(100%, 10rem), 1fr));
    gap: 8px;
    width: 100%;
    max-height: none;
    margin-top: 6px;
    padding: 9px;
    border-radius: 8px;
    box-shadow: none;
  }

  body.print-odeljenja_dani .raspored-archive .raspored-matrix-header__print-button {
    min-height: 33px;
    margin: 0;
    padding: 5px 10px;
    font-size: 13px;
  }

  body.print-odeljenja_dani .raspored-matrix--daily,
  body.print-odeljenja_dani .raspored-daily-matrix {
    padding-block: 9px !important;
  }

  body.print-odeljenja_dani .raspored-daily-block__title {
    margin: 0 0 4px;
    background: #e5eef7;
    color: #173e66;
  }

  body.print-odeljenja_dani .raspored-daily-matrix__table thead th {
    background: #eef4fa;
    color: #173e66;
  }
}

@media screen and (min-width: 1200px) {
  body.print-odeljenja_dani .raspored-matrix-header__right .raspored-matrix-header__mode-selector {
    grid-template-columns: repeat(6, minmax(0, 1fr));
  }
}

@media screen and (max-width: 900px) {
  body.print-odeljenja_dani > .d83-public-tools {
    grid-template-columns: minmax(0, 1fr);
    gap: 6px;
  }
}

@media screen and (max-width: 620px) {
  body.print-odeljenja_dani > .d83-public-tools,
  body.print-odeljenja_dani .raspored-archive__header {
    padding-inline: 9px;
  }

  body.print-odeljenja_dani .d83-public-tools__actions {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  body.print-odeljenja_dani .d83-public-tools__actions label {
    grid-column: auto;
  }

  body.print-odeljenja_dani .d83-public-tools__actions :is(select, input) {
    padding-inline: 5px;
    font-size: 13px;
  }

  body.print-odeljenja_dani .raspored-matrix-header,
  body.print-odeljenja_dani .raspored-matrix-header__right,
  body.print-odeljenja_dani .raspored-matrix-header__right > form {
    grid-template-columns: minmax(0, 1fr);
  }

  body.print-odeljenja_dani .raspored-matrix-header__center {
    text-align: left;
  }

  body.print-odeljenja_dani .raspored-matrix-header :is(p, h1) {
    margin: 0;
  }

  body.print-odeljenja_dani .raspored-archive__header {
    padding-block: 8px;
  }

  body.print-odeljenja_dani .raspored-matrix-header__right,
  body.print-odeljenja_dani .raspored-matrix-header__right > form {
    gap: 5px;
  }

  body.print-odeljenja_dani .raspored-matrix-header__right {
    padding-top: 5px;
  }

  body.print-odeljenja_dani .raspored-matrix-header__right .raspored-matrix-header__mode-selector {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 3px;
    padding: 4px;
  }

  body.print-odeljenja_dani .raspored-matrix-header__mode-selector label {
    padding-inline: 5px;
    font-size: 12px;
  }
}

@media print {
  body.print-odeljenja_dani .raspored-archive__header {
    margin: 0 0 3mm !important;
    padding: 0 !important;
    border: 0 !important;
    background: transparent !important;
    box-shadow: none !important;
  }

  body.print-odeljenja_dani .raspored-matrix-header {
    grid-template-columns: minmax(0, 1fr) auto !important;
    grid-template-areas: "school year" "title validity";
    align-items: end;
    gap: 0.8mm 6mm !important;
    padding: 0 0 1.8mm;
    border-bottom: 0.65pt solid #303030;
    color: #111;
  }

  body.print-odeljenja_dani .raspored-matrix-header__left,
  body.print-odeljenja_dani .raspored-matrix-header__center {
    display: contents;
  }

  body.print-odeljenja_dani .raspored-matrix-header__school {
    grid-area: school;
    font-weight: 700 !important;
  }

  body.print-odeljenja_dani .raspored-matrix-header__year {
    grid-area: year;
    text-align: right;
  }

  body.print-odeljenja_dani .raspored-matrix-header__date {
    grid-area: validity;
    text-align: right;
  }

  body.print-odeljenja_dani .raspored-matrix-header :is(p, h1) {
    margin: 0 !important;
    color: #111 !important;
  }

  body.print-odeljenja_dani .raspored-matrix-header p {
    font: 9pt/1.25 system-ui, Arial, sans-serif;
  }

  body.print-odeljenja_dani .raspored-matrix-header__title {
    grid-area: title;
    font: 700 17pt/1.15 system-ui, Arial, sans-serif !important;
  }

  body.print-odeljenja_dani .raspored-print-only-daily .raspored-print-day__title {
    padding-bottom: 0 !important;
    border-bottom: 0 !important;
  }

  body.print-odeljenja_dani .raspored-print-only-daily .raspored-print-day__table :is(th, td) {
    border: 0.4pt solid #666 !important;
    background: transparent !important;
    color: #111 !important;
  }

  body.print-odeljenja_dani .raspored-print-only-daily .raspored-print-day__table thead th {
    border-top: 0.65pt solid #303030 !important;
    border-bottom: 0.65pt solid #303030 !important;
  }
}

/* Use the daily class print layout for the other public schedule views. */
@media print {
  @page raspored-javni-landscape {
    size: A4 landscape;
    margin: 7mm 6mm 8mm 6mm;
  }

  body[data-public-timetable-view]:is(.print-profesori_zbirno, .print-profesori_dani, .print-odeljenja_zbirno, .print-kabineti_zbirno, .print-kabineti_dani) {
    page: raspored-javni-landscape;
  }

  body[data-public-timetable-view]:is(.print-profesori_zbirno, .print-profesori_dani, .print-odeljenja_zbirno, .print-kabineti_zbirno, .print-kabineti_dani) .raspored-archive__header {
    margin: 0 0 3mm !important;
    padding: 0 !important;
    border: 0 !important;
    background: transparent !important;
    box-shadow: none !important;
  }

  body[data-public-timetable-view]:is(.print-profesori_zbirno, .print-profesori_dani, .print-odeljenja_zbirno, .print-kabineti_zbirno, .print-kabineti_dani) .raspored-matrix-header {
    grid-template-columns: minmax(0, 1fr) auto !important;
    grid-template-areas: "school year" "title validity";
    align-items: end;
    gap: 0.8mm 6mm !important;
    padding: 0 0 1.8mm;
    border-bottom: 0.65pt solid #303030;
    color: #111;
  }

  body[data-public-timetable-view]:is(.print-profesori_zbirno, .print-profesori_dani, .print-odeljenja_zbirno, .print-kabineti_zbirno, .print-kabineti_dani) .raspored-matrix-header :is(.raspored-matrix-header__left, .raspored-matrix-header__center) {
    display: contents;
  }

  body[data-public-timetable-view]:is(.print-profesori_zbirno, .print-profesori_dani, .print-odeljenja_zbirno, .print-kabineti_zbirno, .print-kabineti_dani) .raspored-matrix-header :is(p, h1) {
    margin: 0 !important;
    color: #111 !important;
  }

  body[data-public-timetable-view]:is(.print-profesori_zbirno, .print-profesori_dani, .print-odeljenja_zbirno, .print-kabineti_zbirno, .print-kabineti_dani) .raspored-matrix-header p {
    font: 9pt/1.25 system-ui, Arial, sans-serif !important;
  }

  body[data-public-timetable-view]:is(.print-profesori_zbirno, .print-profesori_dani, .print-odeljenja_zbirno, .print-kabineti_zbirno, .print-kabineti_dani) .raspored-matrix-header__school {
    grid-area: school;
    font-weight: 700 !important;
  }

  body[data-public-timetable-view]:is(.print-profesori_zbirno, .print-profesori_dani, .print-odeljenja_zbirno, .print-kabineti_zbirno, .print-kabineti_dani) .raspored-matrix-header__year {
    grid-area: year;
    text-align: right;
  }

  body[data-public-timetable-view]:is(.print-profesori_zbirno, .print-profesori_dani, .print-odeljenja_zbirno, .print-kabineti_zbirno, .print-kabineti_dani) .raspored-matrix-header__date {
    grid-area: validity;
    text-align: right;
  }

  body[data-public-timetable-view]:is(.print-profesori_zbirno, .print-profesori_dani, .print-odeljenja_zbirno, .print-kabineti_zbirno, .print-kabineti_dani) .raspored-matrix-header__title {
    grid-area: title;
    font: 700 17pt/1.15 system-ui, Arial, sans-serif !important;
  }

  body.print-profesori_zbirno[data-public-timetable-view] .raspored-print-only-teachers--weekly {
    display: block !important;
  }

  body[data-public-timetable-view]:is(.print-profesori_zbirno, .print-profesori_dani, .print-odeljenja_zbirno, .print-kabineti_zbirno, .print-kabineti_dani) :is(.raspored-print-classes-day, .raspored-print-weekly-day, .raspored-print-day, .raspored-print-teacher-week, .raspored-print-teachers-day) {
    margin: 0 0 2.5mm !important;
    padding: 0 !important;
    break-after: auto !important;
    page-break-after: auto !important;
    break-inside: auto !important;
    page-break-inside: auto !important;
  }

  body[data-public-timetable-view]:is(.print-profesori_zbirno, .print-profesori_dani, .print-odeljenja_zbirno, .print-kabineti_zbirno, .print-kabineti_dani) :is(.raspored-print-classes-day, .raspored-print-weekly-day, .raspored-print-day, .raspored-print-teacher-week, .raspored-print-teachers-day):not(:first-child) {
    break-before: auto !important;
    page-break-before: auto !important;
  }

  body[data-public-timetable-view]:is(.print-profesori_zbirno, .print-profesori_dani, .print-odeljenja_zbirno, .print-kabineti_zbirno, .print-kabineti_dani) :is(.raspored-print-classes-day__title, .raspored-print-weekly-day__title, .raspored-print-day__title, .raspored-print-teacher-week__title, .raspored-print-teachers-day__title) {
    margin: 0 0 1mm !important;
    padding: 0 !important;
    border-bottom: 0 !important;
    color: #111 !important;
    font: 700 11pt/1.15 system-ui, Arial, sans-serif !important;
    break-after: avoid-page !important;
    page-break-after: avoid !important;
  }

  body[data-public-timetable-view]:is(.print-profesori_zbirno, .print-profesori_dani, .print-odeljenja_zbirno, .print-kabineti_zbirno, .print-kabineti_dani) :is(.raspored-print-classes-day__table, .raspored-print-weekly-day__table, .raspored-print-day__table, .raspored-print-teacher-week__table, .raspored-print-teachers-day__table) {
    width: 100% !important;
    min-width: 0 !important;
    max-width: 100% !important;
    table-layout: fixed !important;
    border-collapse: collapse !important;
    font-size: 10pt !important;
    background: transparent !important;
    break-inside: auto !important;
    page-break-inside: auto !important;
  }

  body[data-public-timetable-view]:is(.print-profesori_zbirno, .print-profesori_dani, .print-odeljenja_zbirno, .print-kabineti_zbirno, .print-kabineti_dani) :is(.raspored-print-classes-day__table, .raspored-print-weekly-day__table, .raspored-print-day__table, .raspored-print-teacher-week__table, .raspored-print-teachers-day__table) :is(th, td) {
    padding: 0.85mm 0.5mm !important;
    border: 0.4pt solid #666 !important;
    background: transparent !important;
    color: #111 !important;
    overflow: visible !important;
    white-space: normal !important;
    word-break: normal !important;
    overflow-wrap: normal !important;
    hyphens: none !important;
    line-height: 1.2 !important;
  }

  body[data-public-timetable-view]:is(.print-profesori_zbirno, .print-profesori_dani, .print-odeljenja_zbirno, .print-kabineti_zbirno, .print-kabineti_dani) :is(.raspored-print-classes-day__table, .raspored-print-weekly-day__table, .raspored-print-day__table, .raspored-print-teacher-week__table, .raspored-print-teachers-day__table) thead {
    display: table-header-group !important;
    break-inside: avoid-page !important;
    break-after: avoid-page !important;
  }

  body[data-public-timetable-view]:is(.print-profesori_zbirno, .print-profesori_dani, .print-odeljenja_zbirno, .print-kabineti_zbirno, .print-kabineti_dani) :is(.raspored-print-classes-day__table, .raspored-print-weekly-day__table, .raspored-print-day__table, .raspored-print-teacher-week__table, .raspored-print-teachers-day__table) thead th {
    border-top: 0.65pt solid #303030 !important;
    border-bottom: 0.65pt solid #303030 !important;
  }

  body[data-public-timetable-view]:is(.print-profesori_zbirno, .print-profesori_dani, .print-odeljenja_zbirno, .print-kabineti_zbirno, .print-kabineti_dani) :is(.raspored-print-classes-day__table, .raspored-print-weekly-day__table, .raspored-print-day__table, .raspored-print-teacher-week__table, .raspored-print-teachers-day__table) tr {
    break-inside: avoid !important;
    page-break-inside: avoid !important;
  }

  body[data-public-timetable-view]:is(.print-profesori_zbirno, .print-profesori_dani, .print-odeljenja_zbirno, .print-kabineti_zbirno, .print-kabineti_dani) :is(.raspored-print-classes-day__table, .raspored-print-weekly-day__table, .raspored-print-day__table, .raspored-print-teacher-week__table, .raspored-print-teachers-day__table) :is(th, td):first-child {
    width: 7.5mm !important;
  }

  body[data-public-timetable-view]:is(.print-profesori_zbirno, .print-profesori_dani, .print-odeljenja_zbirno, .print-kabineti_zbirno, .print-kabineti_dani) :is(.raspored-print-classes-day__table, .raspored-print-weekly-day__table, .raspored-print-day__table, .raspored-print-teacher-week__table, .raspored-print-teachers-day__table):not(.raspored-print-teacher-week__table) :is(th, td):nth-child(2) {
    width: 23mm !important;
  }

  body[data-public-timetable-view]:is(.print-profesori_zbirno, .print-profesori_dani, .print-odeljenja_zbirno, .print-kabineti_zbirno, .print-kabineti_dani) :is(.raspored-print-classes-day__table, .raspored-print-weekly-day__table, .raspored-print-day__table, .raspored-print-teacher-week__table, .raspored-print-teachers-day__table):not(.raspored-print-teacher-week__table) :is(th, td):nth-child(n + 3),
  body.print-profesori_zbirno[data-public-timetable-view] .raspored-print-teacher-week__table :is(th, td):nth-child(n + 2) {
    width: auto !important;
  }
}

/* Keep weekly teacher and room matrices readable while scrolling locally. */
@media screen {
  body[data-public-timetable-view]:is(.print-profesori_zbirno, .print-kabineti_zbirno) .raspored-matrix__table {
    min-width: 4245px !important;
  }
  body[data-public-timetable-view]:is(.print-profesori_zbirno, .print-kabineti_zbirno, .print-odeljenja_zbirno) .raspored-matrix__table {
    font-size: 13px;
    line-height: 1.3;
  }

  body[data-public-timetable-view]:is(.print-profesori_zbirno, .print-kabineti_zbirno) .raspored-matrix__table thead tr:first-child th:nth-child(2) {
    width: 150px !important;
  }

  body[data-public-timetable-view]:is(.print-profesori_zbirno, .print-kabineti_zbirno) .raspored-matrix__table tbody td:nth-child(n + 2) {
    padding: 5px 6px !important;
    overflow: visible !important;
    white-space: normal !important;
    overflow-wrap: anywhere !important;
  }
  body[data-public-timetable-view].print-odeljenja_zbirno .raspored-matrix__table tbody td:nth-child(n + 3) {
    padding: 5px 6px !important;
    overflow: visible !important;
    white-space: normal !important;
    overflow-wrap: anywhere !important;
  }
}

@media screen and (max-width: 1024px) {
  body[data-public-timetable-view]:is(.print-profesori_zbirno, .print-kabineti_zbirno) .raspored-archive__header {
    margin-bottom: 8px;
    padding-block: 10px;
  }

  body[data-public-timetable-view]:is(.print-profesori_zbirno, .print-kabineti_zbirno) .raspored-matrix-header {
    gap: 8px;
  }

  body[data-public-timetable-view]:is(.print-profesori_zbirno, .print-kabineti_zbirno) .raspored-matrix-header :is(p, h1) {
    margin: 0;
  }

  body[data-public-timetable-view]:is(.print-profesori_zbirno, .print-kabineti_zbirno) .raspored-matrix-header__mode-selector {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(min(100%, 8.5rem), 1fr));
    gap: 5px;
  }

  body[data-public-timetable-view]:is(.print-profesori_zbirno, .print-kabineti_zbirno) .raspored-matrix-header__mode-selector label {
    min-width: 0;
    padding: 5px 6px;
    white-space: normal;
  }
}

@media screen {
  body[data-public-timetable-view]:is(.print-profesori_zbirno, .print-kabineti_zbirno, .print-odeljenja_zbirno) .raspored-matrix__table thead tr:nth-child(2) > th:nth-child(2) {
    text-align: center;
  }
}

@media screen and (max-width: 1024px) {
  body[data-public-timetable-view]:is(.print-profesori_zbirno, .print-kabineti_zbirno, .print-odeljenja_zbirno) .raspored-matrix__table thead tr:first-child > th[colspan] {
    padding-inline-start: 8px;
    text-align: start;
  }
}

/* Kraj kaskade: poništava istorijske fiksne kolone/ellipsis samo na zbirnim ekranima. */
@media screen {
  body[data-public-timetable-view]:is(.print-odeljenja_zbirno,.print-profesori_zbirno,.print-kabineti_zbirno) .raspored-matrix__scroll { width:100%; max-width:100%; min-width:0; overflow-x:auto; overflow-y:hidden; }
  body[data-public-timetable-view]:is(.print-odeljenja_zbirno,.print-profesori_zbirno,.print-kabineti_zbirno) .raspored-matrix__table,
  body[data-public-timetable-view].print-odeljenja_zbirno .raspored-matrix__scroll > .raspored-matrix__table { width:max-content !important; min-width:100% !important; max-width:none !important; table-layout:auto !important; }
  body[data-public-timetable-view]:is(.print-odeljenja_zbirno,.print-profesori_zbirno,.print-kabineti_zbirno) .raspored-matrix__table tbody td:nth-child(n + 3) { width:auto !important; min-width:max-content !important; max-width:none !important; overflow:visible !important; white-space:nowrap !important; overflow-wrap:normal !important; word-break:normal !important; }
  body[data-public-timetable-view]:is(.print-odeljenja_zbirno,.print-profesori_zbirno,.print-kabineti_zbirno) .raspored-matrix-cell__lesson { display:inline-block; min-width:max-content; font-size:12px; white-space:nowrap; overflow:visible; }
}

@media screen and (max-width: 1024px) {
  body:is(.print-profesori_zbirno, .print-kabineti_zbirno)[data-public-timetable-view] .raspored-matrix__table .raspored-matrix__day-label {
    display: inline-block;
    position: sticky;
    inset-inline-start: 8px;
  }
}

/* Align all five teacher and cabinet daily grids independently of lesson text length. */
@media screen {
  body:is(.print-profesori_dani, .print-kabineti_dani)[data-public-timetable-view] .raspored-daily-block > .raspored-daily-matrix__table {
    width: 100% !important;
    min-width: 760px !important;
    table-layout: fixed !important;
  }

  body:is(.print-profesori_dani, .print-kabineti_dani)[data-public-timetable-view] .raspored-daily-matrix__table thead th:first-child {
    width: 42px !important;
  }

  body:is(.print-profesori_dani, .print-kabineti_dani)[data-public-timetable-view] .raspored-daily-matrix__table thead th:nth-child(2) {
    width: 156px !important;
  }

  body:is(.print-profesori_dani, .print-kabineti_dani)[data-public-timetable-view] .raspored-daily-matrix__table :is(th, td):nth-child(n + 2) {
    min-width: 0 !important;
    white-space: normal !important;
    overflow-wrap: anywhere;
  }
}
