html { --interface-font-delta: 0px; }
html[data-interface-scale="small"] { --interface-font-delta: -1px; }
html[data-interface-scale="large"] { --interface-font-delta: 1.5px; }

[hidden] {
    display: none !important;
}


body {
    margin: 0;
    font-family: Arial, Helvetica, sans-serif;
    background: #f5f5f5;
    color: #333;
}


header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px 25px;
    color: white;
    background: #c90016;
}


header h1 {
    margin: 0;
    font-size: calc(24px + var(--interface-font-delta));
}


.header-home-link {
    color: inherit;
    text-decoration: none;
}


.header-home-link:hover {
    color: inherit;
    text-decoration: none;
    opacity: 0.9;
}


nav a {
    margin-left: 20px;
    color: white;
    font-weight: bold;
    text-decoration: none;
}


nav a:hover {
    text-decoration: underline;
}


.container {
    max-width: 1400px;
    margin: auto;
    padding: 20px;
}


.card {
    margin-bottom: 20px;
    padding: 20px;
    background: white;
    border-radius: 10px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
}


button {
    padding: 8px 15px;
    border: none;
    border-radius: 5px;
    font-weight: bold;
    cursor: pointer;
}


.btn-canon {
    color: white;
    background: #c90016;
}


.btn-canon:hover {
    background: #990010;
}


.btn-excel {
    color: white;
    background: #1f8f3a;
}


.btn-excel:hover {
    background: #146b29;
}


table {
    width: 100%;
    border-collapse: collapse;
}


th {
    padding: 10px;
    color: white;
    background: #c90016;
}


td {
    padding: 8px;
    text-align: center;
    border: 1px solid #ddd;
}


tr.weekend {
    background: #eeeeee;
}


tr.swieto {
    background: #ffd0d0;
}


tr.urlop {
    background: #fff2b3;
}


tr.wolne {
    background: #cfe8ff;
}


.nadgodziny {
    color: red;
    font-weight: bold;
}


input,
textarea,
select {
    padding: 7px;
    border: 1px solid #bbb;
    border-radius: 5px;
}


textarea {
    resize: vertical;
}


/* ==========================================
   GŁÓWNY WYBÓR MIESIĄCA + BOCZNE PRZYCISKI
   ========================================== */


.month-picker {
    position: relative;
    display: flex;
    justify-content: center;
}


.month-picker-main-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 14px;
    min-width: 330px;
    padding: 17px 28px;

    color: #ffffff;
    background: linear-gradient(
        135deg,
        #d71920,
        #a90012
    );

    border: 1px solid #93000e;
    border-radius: 16px;

    font-family: inherit;
    cursor: pointer;

    box-shadow:
        0 6px 16px rgba(169, 0, 18, 0.27);

    transition:
        transform 0.15s ease,
        box-shadow 0.15s ease,
        background 0.15s ease;
}


.month-picker-main-button:hover {
    background: linear-gradient(
        135deg,
        #e5232b,
        #b60014
    );

    transform: translateY(-2px);

    box-shadow:
        0 9px 21px rgba(169, 0, 18, 0.32);
}


.month-picker-main-button:active {
    transform: translateY(0);

    box-shadow:
        0 3px 9px rgba(169, 0, 18, 0.23);
}


.month-picker-main-icon {
    font-size: calc(27px + var(--interface-font-delta));
    line-height: 1;
}


.month-picker-main-text {
    font-size: calc(23px + var(--interface-font-delta));
    font-weight: 700;
    line-height: 1;
}


/* BOCZNE PRZYCISKI MIESIĘCY */

.month-side-button {
    display: inline-flex;
    align-items: center;
    gap: 10px;

    padding: 14px 18px;
    min-width: 145px;

    color: #a00012;
    background: #ffffff;

    border: 1px solid #efc8cd;
    border-radius: 14px;

    text-decoration: none;
    font-weight: 700;

    box-shadow:
        0 4px 10px rgba(120, 0, 12, 0.08);

    transition:
        transform 0.15s ease,
        box-shadow 0.15s ease,
        background 0.15s ease,
        color 0.15s ease,
        border-color 0.15s ease;
}


.month-side-button:hover {
    color: #ffffff;
    background: linear-gradient(
        135deg,
        #d71920,
        #a90012
    );

    border-color: #980010;

    transform: translateY(-2px);

    box-shadow:
        0 8px 18px rgba(169, 0, 18, 0.22);
}


.month-side-button:active {
    transform: translateY(0);
}


.month-side-button-icon {
    display: flex;
    align-items: center;
    justify-content: center;

    width: 34px;
    height: 34px;

    font-size: calc(28px + var(--interface-font-delta));
    line-height: 1;

    border-radius: 50%;
    background: #fff4f5;
    color: #c90016;

    transition:
        background 0.15s ease,
        color 0.15s ease;
}


.month-side-button:hover .month-side-button-icon {
    background: rgba(255, 255, 255, 0.15);
    color: #ffffff;
}


.month-side-button-text {
    font-size: calc(14px + var(--interface-font-delta));
    font-weight: 700;
    white-space: nowrap;
}


.month-side-button-next {
    justify-content: flex-end;
}



/* ==========================================
   MINI KALENDARZ MIESIĄCA
   ========================================== */

.picker {
    position: absolute;
    z-index: 1000;
    top: calc(100% + 9px);
    left: 50%;
    display: none;
    width: 320px;
    max-width: calc(100vw - 60px);
    padding: 15px;
    box-sizing: border-box;
    background: white;
    border: 1px solid #ccc;
    border-radius: 12px;
    box-shadow: 0 5px 20px rgba(0, 0, 0, 0.25);
    transform: translateX(-50%);
}


.picker-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px;
    color: white;
    background: #c8102e;
    border-radius: 8px;
    font-size: calc(20px + var(--interface-font-delta));
    font-weight: bold;
}


.picker-header span {
    cursor: pointer;
}


.picker-header span:hover {
    text-decoration: underline;
}


.picker-header button {
    padding: 6px 10px;
    color: white;
    background: transparent;
    border: none;
    font-size: calc(20px + var(--interface-font-delta));
    cursor: pointer;
}


.picker-header button:hover {
    background: rgba(255, 255, 255, 0.14);
}


/* Miesiące */

.miesiace {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 10px;
    margin-top: 15px;
}


.miesiace a {
    padding: 12px 5px;
    color: #333;
    background: #f3f3f3;
    border-radius: 8px;
    text-align: center;
    text-decoration: none;
    transition:
        color 0.15s ease,
        background 0.15s ease,
        transform 0.15s ease;
}


.miesiace a:hover {
    color: white;
    background: #c8102e;
    transform: translateY(-1px);
}


.miesiace a.active {
    color: white;
    background: #c8102e;
    font-weight: bold;
    box-shadow: 0 3px 8px rgba(169, 0, 18, 0.22);
}


/* Wybór lat */

.lata {
    margin-top: 15px;
}


.lata-naglowek {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 15px;
    font-weight: bold;
}


.lata-naglowek button {
    padding: 6px 10px;
    background: transparent;
    border: none;
    font-size: calc(20px + var(--interface-font-delta));
    cursor: pointer;
}


.lata-naglowek button:hover {
    color: white;
    background: #c8102e;
}


.lista-lat {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 10px;
}


.lista-lat button {
    padding: 10px;
    background: #f3f3f3;
    border: none;
    border-radius: 8px;
    cursor: pointer;
}


.lista-lat button:hover {
    color: white;
    background: #c8102e;
}


/* ==========================================
   NAGŁÓWEK WIDOKU TYGODNIOWEGO
   ========================================== */

.calendar-week-title {
    margin: 2px 0 16px;
    color: #8e0010;
    text-align: center;
}


/* ==========================================
   NAWIGACJA TYGODNIA
   ========================================== */



.week-button {
    display: inline-flex;
    align-items: center;
    gap: 12px;
    min-width: 0;
    min-height: 64px;
    padding: 10px 16px;
    color: white;
    background: linear-gradient(
        135deg,
        #d71920,
        #a90012
    );
    border: 1px solid #97000f;
    border-radius: 11px;
    text-decoration: none;
    box-shadow: 0 4px 10px rgba(169, 0, 18, 0.22);
    transition:
        transform 0.15s ease,
        box-shadow 0.15s ease,
        background 0.15s ease;
}


.week-button:hover {
    color: white;
    background: linear-gradient(
        135deg,
        #e5242c,
        #bd0015
    );
    transform: translateY(-2px);
    box-shadow: 0 7px 16px rgba(169, 0, 18, 0.28);
}


.week-button:active {
    transform: translateY(0);
    box-shadow: 0 3px 7px rgba(169, 0, 18, 0.22);
}


.week-button-next {
    justify-content: flex-end;
    text-align: right;
}


.week-button-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 34px;
    height: 34px;
    flex-shrink: 0;
    font-size: calc(30px + var(--interface-font-delta));
    line-height: 1;
    background: rgba(255, 255, 255, 0.16);
    border-radius: 50%;
}


.week-button-text {
    display: flex;
    flex-direction: column;
    line-height: 1.1;
}


.week-button-text small {
    margin-bottom: 3px;
    font-size: calc(11px + var(--interface-font-delta));
    font-weight: normal;
    text-transform: uppercase;
    letter-spacing: 0.6px;
    opacity: 0.82;
}


.week-button-text strong {
    font-size: calc(15px + var(--interface-font-delta));
}


.week-range {
    flex: 1;
    padding: 10px 14px;
    color: #8e0010;
    background: white;
    border: 1px solid #ecc3c8;
    border-radius: 10px;
    text-align: center;
    font-weight: bold;
    white-space: nowrap;
}


.week-range span {
    margin: 0 7px;
    color: #c90016;
}


/* ==========================================
   PRZEŁĄCZNIK WIDOKU KALENDARZA
   ========================================== */

.calendar-view-switch-wrapper {
    display: flex;
    justify-content: center;
    width: 100%;
}


.calendar-view-switch {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    margin: 0 0 18px;
    padding: 5px;
    background: #f4f4f4;
    border: 1px solid #dddddd;
    border-radius: 14px;
    box-shadow: inset 0 1px 2px rgba(0, 0, 0, 0.05);
}


.calendar-view-button {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    min-width: 170px;
    padding: 10px 15px;
    color: #555555;
    background: transparent;
    border: 1px solid transparent;
    border-radius: 10px;
    text-decoration: none;
    transition:
        color 0.15s ease,
        background 0.15s ease,
        border-color 0.15s ease,
        transform 0.15s ease,
        box-shadow 0.15s ease;
}


.calendar-view-button:hover {
    color: #a90012;
    background: #ffffff;
    border-color: #e5b9be;
    transform: translateY(-1px);
    box-shadow: 0 3px 8px rgba(0, 0, 0, 0.08);
}


.calendar-view-button.active {
    color: #ffffff;
    background: linear-gradient(
        135deg,
        #d71920,
        #a90012
    );
    border-color: #980010;
    box-shadow: 0 4px 10px rgba(169, 0, 18, 0.24);
}


.calendar-view-button.active:hover {
    color: #ffffff;
    background: linear-gradient(
        135deg,
        #e5222a,
        #b60014
    );
}


.calendar-view-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 34px;
    height: 34px;
    flex-shrink: 0;
    color: #b00014;
    background: #ffffff;
    border: 1px solid #e4c5c8;
    border-radius: 9px;
    font-size: calc(20px + var(--interface-font-delta));
}


.calendar-view-button.active .calendar-view-icon {
    color: #a90012;
    border-color: rgba(255, 255, 255, 0.65);
}


.calendar-view-text {
    display: flex;
    flex-direction: column;
    line-height: 1.15;
}


.calendar-view-text small {
    margin-bottom: 2px;
    font-size: calc(10px + var(--interface-font-delta));
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.7px;
    opacity: 0.72;
}


.calendar-view-text strong {
    font-size: calc(14px + var(--interface-font-delta));
    font-weight: 700;
}


/* ==========================================
   WSPÓLNA SZEROKOŚĆ NAWIGACJI
   MIESIĄC / TYDZIEŃ
   ========================================== */

.month-picker-wrap,
.week-navigation {
    display: grid;
    grid-template-columns: 180px minmax(0, 1fr) 180px;
    align-items: stretch;
    gap: 16px;

    width: 100%;
    max-width: 760px;
    margin: 2px auto 22px;

    box-sizing: border-box;
}


/* Pasek miesięczny */

.month-picker-wrap {
    padding: 0;
}


/* Pasek tygodniowy */

.week-navigation {
    padding: 0;
    background: transparent;
    border: none;
    border-radius: 0;
}


/* Boczne przyciski mają identyczne kolumny */

.month-side-button,
.week-button {
    width: 100%;
    min-width: 0;
    min-height: 64px;

    box-sizing: border-box;
}


/* Środkowe elementy zajmują całą środkową kolumnę */

.month-picker,
.week-range {
    width: 100%;
    min-width: 0;

    box-sizing: border-box;
}


/* Główny przycisk miesiąca */

.month-picker-main-button {
    width: 100%;
    min-width: 0;
    min-height: 64px;

    box-sizing: border-box;
}


/* Środkowy zakres tygodnia */

.week-range {
    display: flex;
    align-items: center;
    justify-content: center;

    min-height: 64px;
    padding: 10px 14px;
}


/* ==========================================
   RESPONSYWNOŚĆ NAWIGACJI
   ========================================== */

@media (max-width: 800px) {

    .month-picker-wrap,
    .week-navigation {
        grid-template-columns: 150px minmax(0, 1fr) 150px;
        gap: 10px;

        max-width: 100%;
    }

}


@media (max-width: 700px) {

    .month-picker-wrap,
    .week-navigation {
        grid-template-columns: 1fr 1fr;
        align-items: stretch;
        gap: 10px;

        width: 100%;
        max-width: none;
    }


    .month-picker,
    .week-range {
        grid-column: 1 / -1;
        grid-row: 1;
    }


    .month-side-button,
    .week-button {
        justify-content: center;
    }


    .month-picker-main-button {
        width: 100%;
        min-width: 0;
    }

}


@media (max-width: 600px) {

    .month-picker-main-button {
        padding: 15px 18px;
    }


    .month-picker-main-text {
        font-size: calc(20px + var(--interface-font-delta));
    }


    .month-picker-main-icon {
        font-size: calc(24px + var(--interface-font-delta));
    }


    .calendar-view-switch {
        display: flex;
        width: 100%;
    }


    .calendar-view-button {
        flex: 1;
        min-width: 0;
        padding: 9px 10px;
    }


    .calendar-view-icon {
        display: none;
    }


    .calendar-view-text strong {
        font-size: calc(13px + var(--interface-font-delta));
    }

}

/* Doprecyzowanie wyglądu bocznych przycisków miesiąca */

.month-side-button {
    justify-content: flex-start;
}

.month-side-button-next {
    justify-content: flex-end;
}

.month-side-button-icon {
    flex-shrink: 0;
}

.month-side-button-text {
    flex: 1;
    text-align: center;
}

@media (max-width: 700px) {
    .month-side-button,
    .month-side-button-next {
        justify-content: center;
    }

    .month-side-button-text {
        flex: 0 1 auto;
    }
}

/* ==========================================
   PODSUMOWANIE MIESIĄCA
   ========================================== */

.month-summary {
    display: grid;
    grid-template-columns: repeat(5, minmax(130px, 1fr));
    gap: 12px;
    margin: 0 0 18px;
}

.summary-tile {
    display: flex;
    flex-direction: column;
    gap: 7px;
    min-height: 74px;
    padding: 14px 16px;
    box-sizing: border-box;
    background: #fff;
    border: 1px solid #e5d7d9;
    border-top: 4px solid #c90016;
    border-radius: 12px;
    box-shadow: 0 3px 10px rgba(0, 0, 0, 0.07);
}

.summary-tile span {
    color: #676767;
    font-size: calc(12px + var(--interface-font-delta));
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.45px;
}

.summary-tile strong {
    color: #8f0010;
    font-size: calc(23px + var(--interface-font-delta));
}

.summary-tile.overtime {
    border-top-color: #e17200;
}

.summary-tile.overtime strong {
    color: #bf4f00;
}

.summary-tile.leave {
    border-top-color: #299543;
}

.summary-tile.leave strong {
    color: #1f7434;
}

.summary-tile.remaining {
    border-top-color: #5c4db1;
}

.summary-tile.remaining strong {
    color: #4b3d98;
}


/* ==========================================
   TABELA EWIDENCJI I EDYCJA DNIA
   ========================================== */

.calendar-table-wrap {
    width: 100%;
    overflow-x: auto;
    border: 1px solid #dedede;
    border-radius: 12px;
}

.work-calendar {
    min-width: 1320px;
    margin: 0;
}

.work-calendar thead th {
    position: sticky;
    top: 0;
    z-index: 2;
    padding: 12px 9px;
    white-space: nowrap;
}

.work-calendar td {
    vertical-align: top;
    padding: 10px;
}

.work-calendar .date-cell {
    min-width: 108px;
}

.work-calendar .date-cell strong {
    display: block;
    white-space: nowrap;
}

.holiday-name {
    display: block;
    max-width: 135px;
    margin-top: 5px;
    color: #9d0012;
    font-size: calc(11px + var(--interface-font-delta));
    line-height: 1.25;
}

.work-calendar .clients-cell {
    min-width: 220px;
}

.work-calendar .clients-cell > small {
    display: block;
    margin-top: 5px;
    color: #777;
    font-size: calc(10px + var(--interface-font-delta));
    text-align: left;
}

.work-calendar textarea {
    width: 190px;
    min-height: 84px;
    box-sizing: border-box;
}

.day-row.weekend:not(.urlop):not(.wolne):not(.swieto) {
    background: #fff3ed;
}

.day-row.swieto:not(.urlop):not(.wolne) {
    background: #ffe4e4;
}


/* Wiele wpisów czasu */

.time-entries-cell {
    min-width: 520px;
}

.time-entries {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.time-entry {
    padding: 10px;
    background: #fafafa;
    border: 1px solid #ddd;
    border-left: 4px solid #c90016;
    border-radius: 10px;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.05);
}

.time-entry-heading {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 8px;
    color: #85000e;
}

.time-entry-remove {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 28px;
    height: 28px;
    padding: 0;
    color: #9a0010;
    background: #fff;
    border: 1px solid #e5b9bf;
    border-radius: 50%;
    font-size: calc(20px + var(--interface-font-delta));
    line-height: 1;
}

.time-entry-remove:hover {
    color: #fff;
    background: #c90016;
}

.time-entry-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 8px;
}

.time-entry fieldset {
    min-width: 0;
    margin: 0;
    padding: 8px;
    border: 1px solid #ddd;
    border-radius: 8px;
}

.time-entry legend {
    padding: 0 5px;
    color: #6f0010;
    font-size: calc(12px + var(--interface-font-delta));
    font-weight: bold;
}

.time-pair {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 5px;
}

.time-pair label {
    display: flex;
    flex-direction: column;
    gap: 3px;
    color: #666;
    font-size: calc(10px + var(--interface-font-delta));
    text-align: left;
}

.time-pair input[type="time"] {
    width: 100%;
    min-width: 0;
    padding: 5px;
    box-sizing: border-box;
}

.compact-check {
    display: flex;
    align-items: center;
    gap: 5px;
    margin-top: 6px;
    color: #666;
    font-size: calc(10px + var(--interface-font-delta));
    text-align: left;
}

.compact-check input {
    margin: 0;
    padding: 0;
}

.next-day-check {
    color: #8d0010;
    font-weight: 600;
}

.add-entry-button {
    width: 100%;
    margin-top: 9px;
    padding: 8px 10px;
    color: #950010;
    background: #fff4f5;
    border: 1px dashed #d38b94;
    border-radius: 8px;
}

.add-entry-button:hover {
    color: #fff;
    background: #c90016;
    border-style: solid;
}


/* Klienci */

.client-autocomplete {
    position: relative;
}

.multi-client-input {
    width: 100%;
    box-sizing: border-box;
}

.client-suggestions {
    position: absolute;
    z-index: 1200;
    top: calc(100% + 4px);
    left: 0;
    right: 0;
    max-height: 220px;
    overflow-y: auto;
    padding: 5px;
    background: #fff;
    border: 1px solid #d0d0d0;
    border-radius: 9px;
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.2);
}

.client-suggestions[hidden] {
    display: none;
}

.client-suggestions button {
    display: block;
    width: 100%;
    padding: 8px 10px;
    color: #333;
    background: #fff;
    border-radius: 6px;
    text-align: left;
}

.client-suggestions button:hover {
    color: #fff;
    background: #c90016;
}


/* Status i akcje */

.status-option {
    display: flex;
    align-items: center;
    gap: 6px;
    margin-bottom: 8px;
    text-align: left;
    white-space: nowrap;
}

.remote-time {
    display: flex;
    align-items: center;
    gap: 5px;
}

.remote-time[hidden] {
    display: none;
}

.remote-time input {
    width: 72px;
}

.day-summary-cell {
    min-width: 120px;
}

.day-summary-cell span {
    display: flex;
    justify-content: space-between;
    gap: 8px;
    padding: 5px 0;
    border-bottom: 1px solid rgba(0, 0, 0, 0.08);
    font-size: calc(11px + var(--interface-font-delta));
    text-align: left;
}

.day-summary-cell strong {
    white-space: nowrap;
}

.day-actions {
    min-width: 118px;
}

.day-actions form {
    margin-top: 7px;
}

.action-button,
.delete-day-button {
    width: 100%;
    padding: 9px 10px;
    white-space: nowrap;
}

.delete-day-button {
    color: #8f0010;
    background: #fff;
    border: 1px solid #e2aeb5;
}

.delete-day-button:hover {
    color: #fff;
    background: #9d0012;
}


/* Eksport */

.export-card {
    max-width: 650px;
    margin-left: auto;
    margin-right: auto;
}

.export-form {
    display: grid;
    grid-template-columns: 1fr 1fr auto;
    align-items: end;
    gap: 14px;
}

.export-form label {
    display: flex;
    flex-direction: column;
    gap: 6px;
    font-weight: bold;
}

.export-form input,
.export-form select {
    width: 100%;
    box-sizing: border-box;
}

.export-form button {
    min-height: 40px;
}


@media (max-width: 1100px) {
    .month-summary {
        grid-template-columns: repeat(3, minmax(130px, 1fr));
    }
}

@media (max-width: 700px) {
    .month-summary {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .summary-tile:last-child {
        grid-column: 1 / -1;
    }

    .export-form {
        grid-template-columns: 1fr;
    }
}


/* ==========================================
   CZYTELNY WIDOK PODSUMOWANIA KALENDARZA
   ========================================== */

.calendar-overview-card {
    overflow: visible;
}

.period-summary {
    width: 100%;
    max-width: 1080px;
    margin: 2px auto 22px;
}

.period-summary-heading {
    margin-bottom: 8px;
    color: #777;
    font-size: calc(12px + var(--interface-font-delta));
    font-weight: 700;
    text-align: center;
    text-transform: uppercase;
    letter-spacing: 0.8px;
}

.period-summary-grid {
    display: grid;
    grid-template-columns: repeat(5, minmax(0, 1fr));
    gap: 10px;
}

.period-summary-grid.week-summary-grid {
    grid-template-columns: repeat(4, minmax(0, 1fr));
    max-width: 880px;
    margin: 0 auto;
}

.calendar-summary-wrap {
    width: 100%;
    overflow-x: auto;
    border: 1px solid #e3e3e3;
    border-radius: 14px;
    box-shadow: 0 3px 12px rgba(0, 0, 0, 0.06);
}

.calendar-summary-table {
    width: 100%;
    min-width: 850px;
    border-collapse: separate;
    border-spacing: 0;
    background: #fff;
}

.calendar-summary-table th {
    padding: 13px 14px;
    background: #c90016;
    border-right: 1px solid rgba(255, 255, 255, 0.18);
    font-size: calc(13px + var(--interface-font-delta));
    text-align: left;
    white-space: nowrap;
}

.calendar-summary-table th:first-child {
    border-top-left-radius: 13px;
}

.calendar-summary-table th:last-child {
    border-top-right-radius: 13px;
    border-right: 0;
}

.calendar-summary-table td {
    padding: 13px 14px;
    border: 0;
    border-right: 1px solid #ececec;
    border-bottom: 1px solid #e6e6e6;
    text-align: left;
    vertical-align: middle;
}

.calendar-summary-table td:last-child {
    border-right: 0;
}

.calendar-summary-table tbody tr:last-child td {
    border-bottom: 0;
}

.summary-day-row {
    position: relative;
    cursor: pointer;
    transition:
        background 0.14s ease,
        box-shadow 0.14s ease,
        transform 0.14s ease;
}

.summary-day-row:hover,
.summary-day-row:focus-visible {
    background: #fff7f8;
    box-shadow: inset 4px 0 0 #c90016;
    outline: none;
}

.summary-day-row:active {
    background: #ffeff1;
}

.summary-day-row.weekend:not(.urlop):not(.wolne):not(.swieto) {
    background: #f6f6f6;
}

.summary-day-row.swieto:not(.urlop):not(.wolne) {
    background: #ffe1e1;
}

.summary-day-row.urlop {
    background: #fff3bd;
}

.summary-day-row.wolne {
    background: #dceeff;
}

.summary-date-cell {
    width: 145px;
}

.summary-date-cell small {
    display: block;
    max-width: 180px;
    margin-top: 4px;
    color: #a00012;
    font-size: calc(10px + var(--interface-font-delta));
    line-height: 1.25;
}

.summary-day-link {
    color: #222;
    font-weight: 800;
    text-decoration: none;
}

.summary-day-link:hover {
    color: #c90016;
    text-decoration: underline;
}

.summary-weekday-cell {
    width: 110px;
    color: #555;
    font-weight: 700;
}

.summary-client-cell {
    min-width: 230px;
    font-weight: 600;
    line-height: 1.35;
}

.summary-hours-cell,
.summary-overtime-cell {
    width: 125px;
    text-align: center !important;
    font-variant-numeric: tabular-nums;
}

.summary-hours-cell strong,
.summary-overtime-cell strong {
    font-size: calc(17px + var(--interface-font-delta));
}

.summary-overtime-cell strong {
    color: #777;
}

.summary-overtime-cell.has-overtime strong {
    color: #c90016;
}

.summary-notes-cell {
    position: relative;
    min-width: 260px;
    padding-right: 42px !important;
    color: #555;
    line-height: 1.35;
}

.row-edit-arrow {
    position: absolute;
    top: 50%;
    right: 15px;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 27px;
    height: 27px;
    color: #c90016;
    background: #fff;
    border: 1px solid #efc9ce;
    border-radius: 50%;
    font-size: calc(22px + var(--interface-font-delta));
    font-weight: 700;
    line-height: 1;
    transform: translateY(-50%);
    transition:
        color 0.14s ease,
        background 0.14s ease,
        transform 0.14s ease;
}

.summary-day-row:hover .row-edit-arrow {
    color: #fff;
    background: #c90016;
    transform: translateY(-50%) translateX(2px);
}

.empty-summary-value {
    color: #999;
    font-weight: 400;
    font-style: italic;
}

.status-chip {
    display: inline-flex;
    padding: 5px 9px;
    border-radius: 999px;
    font-size: calc(12px + var(--interface-font-delta));
    font-weight: 800;
}

.leave-chip {
    color: #6e5600;
    background: #ffe889;
}

.free-chip {
    color: #075384;
    background: #bfe2ff;
}


/* ==========================================
   OSOBNA STRONA EDYCJI DNIA
   ========================================== */

.day-editor-page {
    max-width: 1180px;
    margin: 0 auto;
}

.day-editor-topbar {
    margin-bottom: 12px;
}

.back-to-calendar-button,
.secondary-action-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 10px 15px;
    color: #8d0010;
    background: #fff;
    border: 1px solid #e8c4c8;
    border-radius: 10px;
    font-weight: 700;
    text-decoration: none;
    transition:
        background 0.15s ease,
        border-color 0.15s ease,
        transform 0.15s ease;
}

.back-to-calendar-button:hover,
.secondary-action-button:hover {
    color: #8d0010;
    background: #fff3f4;
    border-color: #d99ba3;
    transform: translateY(-1px);
}

.back-to-calendar-button span {
    font-size: calc(24px + var(--interface-font-delta));
    line-height: 0.7;
}

.day-editor-card {
    padding: 24px;
}

.day-editor-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 24px;
    margin-bottom: 22px;
    padding-bottom: 20px;
    border-bottom: 1px solid #e9e9e9;
}

.day-editor-eyebrow {
    display: block;
    margin-bottom: 5px;
    color: #a00012;
    font-size: calc(11px + var(--interface-font-delta));
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.9px;
}

.day-editor-header h2 {
    margin: 0;
    font-size: calc(26px + var(--interface-font-delta));
}

.day-editor-holiday {
    margin: 6px 0 0;
    color: #c90016;
    font-size: calc(13px + var(--interface-font-delta));
    font-weight: 700;
}

.day-editor-summary {
    display: grid;
    grid-template-columns: repeat(3, minmax(110px, 1fr));
    gap: 8px;
    min-width: 410px;
}

.day-editor-summary > div {
    padding: 11px 13px;
    background: #f7f7f7;
    border: 1px solid #e4e4e4;
    border-radius: 10px;
    text-align: center;
}

.day-editor-summary span {
    display: block;
    margin-bottom: 4px;
    color: #777;
    font-size: calc(10px + var(--interface-font-delta));
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.45px;
}

.day-editor-summary strong {
    font-size: calc(20px + var(--interface-font-delta));
    font-variant-numeric: tabular-nums;
}

.day-editor-summary .overtime strong {
    color: #c90016;
}

.day-editor-form {
    display: grid;
    gap: 20px;
}

.day-editor-section {
    padding: 20px;
    background: #fafafa;
    border: 1px solid #e2e2e2;
    border-radius: 14px;
}

.section-heading {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 18px;
    margin-bottom: 18px;
}

.section-heading > div {
    display: flex;
    align-items: center;
    gap: 10px;
}

.section-heading h3 {
    margin: 0;
    font-size: calc(18px + var(--interface-font-delta));
}

.section-heading p {
    margin: 0;
    color: #777;
    font-size: calc(13px + var(--interface-font-delta));
}

.section-number {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 28px;
    height: 28px;
    color: #fff;
    background: #c90016;
    border-radius: 50%;
    font-size: calc(13px + var(--interface-font-delta));
    font-weight: 800;
}

.day-basic-grid {
    display: grid;
    grid-template-columns: minmax(0, 2fr) minmax(240px, 1fr);
    gap: 18px 22px;
}

.editor-field {
    min-width: 0;
}

.editor-field-wide {
    grid-column: 1 / -1;
}

.editor-field > label:first-child,
.field-label {
    display: block;
    margin-bottom: 7px;
    color: #444;
    font-size: calc(13px + var(--interface-font-delta));
    font-weight: 800;
}

.editor-field input[type="text"],
.editor-field input:not([type]),
.editor-field textarea,
.multi-client-input {
    width: 100%;
    box-sizing: border-box;
}

.editor-field small {
    display: block;
    margin-top: 6px;
    color: #777;
}

.status-options-row {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.status-option-large {
    padding: 10px 12px;
    background: #fff;
    border: 1px solid #ddd;
    border-radius: 9px;
}

.remote-time-editor {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-top: 10px;
}

.remote-time-editor {
    flex-wrap: wrap;
}

.remote-duration-field {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    margin: 0;
    font-weight: 600;
}

.remote-time-editor .remote-duration-field input {
    width: 78px;
    text-align: center;
}

.day-time-entries {
    display: grid;
    gap: 14px;
}

.day-editor-section .time-entry {
    margin: 0;
    background: #fff;
}

.section-heading-with-action {
    align-items: center;
}

.day-editor-actions {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 10px;
    padding-top: 2px;
}

.save-day-button {
    min-width: 190px;
    padding: 12px 18px;
    border-radius: 10px;
    font-size: calc(15px + var(--interface-font-delta));
}

.delete-day-form {
    display: flex;
    justify-content: flex-end;
    margin-top: 12px;
    padding-top: 14px;
    border-top: 1px solid #eee;
}

.delete-day-button {
    color: #a00012;
    background: #fff;
    border: 1px solid #e5b4ba;
}

.delete-day-button:hover {
    color: #fff;
    background: #a90012;
}


/* ==========================================
   RESPONSYWNOŚĆ NOWYCH WIDOKÓW
   ========================================== */

@media (max-width: 950px) {
    .period-summary-grid,
    .period-summary-grid.week-summary-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        max-width: none;
    }

    .period-summary-grid .summary-tile:last-child {
        grid-column: 1 / -1;
    }

    .day-editor-header {
        align-items: flex-start;
        flex-direction: column;
    }

    .day-editor-summary {
        width: 100%;
        min-width: 0;
    }
}

@media (max-width: 700px) {
    .day-editor-card {
        padding: 15px;
    }

    .day-editor-header h2 {
        font-size: calc(21px + var(--interface-font-delta));
    }

    .day-editor-summary {
        grid-template-columns: 1fr;
    }

    .day-basic-grid {
        grid-template-columns: 1fr;
    }

    .editor-field-wide {
        grid-column: auto;
    }

    .section-heading,
    .section-heading-with-action {
        align-items: flex-start;
        flex-direction: column;
    }

    .section-heading p {
        padding-left: 38px;
    }

    .add-entry-button {
        width: 100%;
    }

    .day-editor-actions {
        align-items: stretch;
        flex-direction: column;
    }

    .save-day-button,
    .secondary-action-button {
        width: 100%;
        box-sizing: border-box;
    }

    .period-summary-grid,
    .period-summary-grid.week-summary-grid {
        grid-template-columns: 1fr 1fr;
    }
}

@media (max-width: 480px) {
    .period-summary-grid,
    .period-summary-grid.week-summary-grid {
        grid-template-columns: 1fr;
    }

    .period-summary-grid .summary-tile:last-child {
        grid-column: auto;
    }
}

/* ==========================================
   KONTO, LOGOWANIE I KOMUNIKATY
   ========================================== */

header {
    gap: 20px;
}

header nav {
    display: flex;
    align-items: center;
    justify-content: center;
    flex-wrap: wrap;
    gap: 6px 18px;
    flex: 1;
}

header nav a {
    margin-left: 0;
}

.header-account {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-shrink: 0;
}

.header-user-link {
    color: #fff;
    font-weight: 800;
    text-decoration: none;
}

.header-user-link:hover {
    text-decoration: underline;
}

.header-account form {
    margin: 0;
}

.header-logout-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 7px 10px;
    color: #fff;
    background: rgba(255, 255, 255, 0.13);
    border: 1px solid rgba(255, 255, 255, 0.4);
}

.header-logout-button:hover {
    background: rgba(255, 255, 255, 0.24);
}

.header-close-button {
    display: none;
    align-items: center;
    justify-content: center;
    gap: 5px;
    padding: 7px 10px;
    color: #9b0011;
    background: #fff;
    border: 1px solid #fff;
}

.header-close-button:hover {
    color: #76000d;
    background: #fff2f4;
}

.header-action-icon {
    width: 17px;
    height: 17px;
    flex: 0 0 17px;
    fill: none;
    stroke: currentColor;
    stroke-width: 2;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.flash-list {
    display: grid;
    gap: 8px;
    margin-bottom: 15px;
}

.flash-message {
    padding: 11px 14px;
    background: #f2f2f2;
    border: 1px solid #ddd;
    border-radius: 9px;
    font-weight: 700;
}

.flash-message.blad {
    color: #8e0010;
    background: #fff0f2;
    border-color: #e8b8be;
}

.flash-message.sukces {
    color: #146427;
    background: #edf9ef;
    border-color: #b9dfc0;
}

.auth-page {
    display: flex;
    justify-content: center;
    padding-top: 45px;
}

.auth-card {
    width: min(430px, 100%);
    padding: 30px;
}

.auth-card-wide {
    width: min(560px, 100%);
}

.auth-eyebrow,
.page-eyebrow {
    display: block;
    margin-bottom: 5px;
    color: #a00012;
    font-size: calc(11px + var(--interface-font-delta));
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.85px;
}

.auth-card h2,
.page-heading-row h2 {
    margin: 0 0 18px;
}

.auth-form {
    display: grid;
    gap: 14px;
}

.auth-form label,
.admin-add-user-form label,
.stats-filter-form label {
    display: grid;
    gap: 6px;
    color: #444;
    font-size: calc(13px + var(--interface-font-delta));
    font-weight: 800;
}

.auth-form input,
.admin-add-user-form input {
    width: 100%;
    box-sizing: border-box;
}

.auth-submit {
    margin-top: 5px;
    padding: 12px 18px;
}

.narrow-card {
    max-width: 560px;
    margin-left: auto;
    margin-right: auto;
}

/* ==========================================
   HISTORIA KLIENTÓW
   ========================================== */

.page-heading-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
    margin-bottom: 22px;
}

.client-card-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(310px, 1fr));
    gap: 15px;
}

.client-history-card {
    display: block;
    padding: 18px;
    color: #333;
    background: #fff;
    border: 1px solid #e3e3e3;
    border-radius: 14px;
    text-decoration: none;
    box-shadow: 0 3px 12px rgba(0, 0, 0, 0.06);
    transition: transform 0.15s ease, box-shadow 0.15s ease, border-color 0.15s ease;
}

.client-history-card:hover {
    color: #333;
    border-color: #e0a5ad;
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(130, 0, 15, 0.12);
}

.disabled-card {
    opacity: 0.75;
}

.client-card-heading,
.admin-user-main {
    display: flex;
    align-items: center;
    gap: 12px;
}

.client-card-heading h3,
.admin-user-main h3 {
    flex: 1;
    margin: 0;
}

.client-avatar {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 42px;
    height: 42px;
    flex-shrink: 0;
    color: #fff;
    background: linear-gradient(135deg, #d71920, #990010);
    border-radius: 12px;
    font-size: calc(19px + var(--interface-font-delta));
    font-weight: 800;
}

.client-card-arrow {
    color: #c90016;
    font-size: calc(28px + var(--interface-font-delta));
}

.client-card-stats,
.client-detail-metrics {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 8px;
    margin-top: 16px;
}

.client-card-stats > div,
.client-detail-metrics > div {
    padding: 10px 7px;
    background: #f7f7f7;
    border-radius: 9px;
    text-align: center;
}

.client-card-stats strong,
.client-detail-metrics strong {
    display: block;
    font-size: calc(17px + var(--interface-font-delta));
    font-variant-numeric: tabular-nums;
}

.client-card-stats span,
.client-detail-metrics span {
    display: block;
    margin-top: 3px;
    color: #777;
    font-size: calc(9px + var(--interface-font-delta));
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.4px;
}

.empty-state,
.empty-timeline {
    padding: 30px;
    color: #777;
    background: #f7f7f7;
    border: 1px dashed #ccc;
    border-radius: 12px;
    text-align: center;
}

.client-detail-page {
    max-width: 1200px;
    margin: 0 auto;
}

.client-detail-page > .back-to-calendar-button {
    margin-bottom: 12px;
}

.client-detail-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 24px;
}

.client-detail-header h2 {
    margin: 0;
    font-size: calc(28px + var(--interface-font-delta));
}

.client-detail-metrics {
    min-width: 560px;
    margin-top: 0;
}

.visit-list {
    display: grid;
    gap: 14px;
}

.visit-card {
    padding: 20px;
}

.visit-card-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 20px;
    margin-bottom: 20px;
}

.visit-card-header h3 {
    margin: 0;
}

.visit-card-header p {
    margin: 5px 0 0;
    color: #666;
}

.visit-hours {
    min-width: 150px;
    text-align: right;
}

.visit-hours span,
.visit-hours small {
    display: block;
    color: #777;
    font-size: calc(10px + var(--interface-font-delta));
    font-weight: 700;
    text-transform: uppercase;
}

.visit-hours strong {
    display: block;
    margin: 2px 0;
    color: #a90012;
    font-size: calc(25px + var(--interface-font-delta));
}

.timeline {
    padding: 10px 10px 8px;
    background: #fafafa;
    border: 1px solid #e1e1e1;
    border-radius: 12px;
    overflow-x: auto;
}

.timeline-axis,
.timeline-track {
    position: relative;
    min-width: 760px;
}

.timeline-axis {
    height: 24px;
    margin: 0 8px;
    border-bottom: 1px solid #ccc;
}

.timeline-axis span {
    position: absolute;
    bottom: 4px;
    color: #666;
    font-size: calc(10px + var(--interface-font-delta));
    transform: translateX(-50%);
}

.timeline-axis span::after {
    content: "";
    position: absolute;
    top: 16px;
    left: 50%;
    width: 1px;
    height: 62px;
    background: #e4e4e4;
}

.timeline-track {
    height: 78px;
    margin: 8px;
}

.timeline-segment {
    position: absolute;
    display: flex;
    align-items: center;
    gap: 5px;
    min-width: 12px;
    height: 21px;
    padding: 0 5px;
    box-sizing: border-box;
    border-radius: 7px;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.14);
    overflow: hidden;
    white-space: nowrap;
}

.timeline-segment.dojazd {
    top: 2px;
    color: #063d64;
    background: #b8ddf5;
    border: 1px solid #73b8e4;
}

.timeline-segment.praca {
    top: 29px;
    color: #fff;
    background: linear-gradient(135deg, #d71920, #a00012);
    border: 1px solid #90000e;
}

.timeline-segment.powrot {
    top: 56px;
    color: #5c4000;
    background: #f8d88d;
    border: 1px solid #d9ae45;
}

.timeline-icon {
    flex-shrink: 0;
    font-size: calc(11px + var(--interface-font-delta));
}

.timeline-label {
    overflow: hidden;
    font-size: calc(10px + var(--interface-font-delta));
    font-weight: 800;
    text-overflow: ellipsis;
}

.remote-visit-badge {
    display: inline-flex;
    margin-top: 10px;
    padding: 6px 10px;
    color: #075384;
    background: #e2f2ff;
    border-radius: 999px;
    font-size: calc(12px + var(--interface-font-delta));
    font-weight: 800;
}

.visit-edit-link {
    display: block;
    margin-top: 12px;
    color: #a00012;
    font-weight: 800;
    text-align: right;
    text-decoration: none;
}

/* ==========================================
   STATYSTYKI
   ========================================== */

.stats-filter-form {
    display: flex;
    align-items: flex-end;
    gap: 8px;
    flex-wrap: wrap;
}

.stats-filter-form input,
.stats-filter-form select {
    min-width: 110px;
}

.stats-tabs {
    display: inline-flex;
    gap: 5px;
    margin-bottom: 18px;
    padding: 5px;
    background: #f1f1f1;
    border: 1px solid #ddd;
    border-radius: 12px;
}

.stats-tabs a {
    padding: 9px 15px;
    color: #555;
    border-radius: 8px;
    font-weight: 800;
    text-decoration: none;
}

.stats-tabs a.active {
    color: #fff;
    background: #c90016;
}

.stats-period-title {
    margin: 0 0 14px;
}

.stats-primary-grid,
.ranking-card-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 12px;
    margin-bottom: 16px;
}

.stats-primary-grid article,
.ranking-card {
    padding: 16px;
    background: #f7f7f7;
    border: 1px solid #e2e2e2;
    border-radius: 12px;
}

.stats-primary-grid span,
.ranking-card > span {
    display: block;
    margin-bottom: 6px;
    color: #777;
    font-size: calc(10px + var(--interface-font-delta));
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.55px;
}

.stats-primary-grid strong,
.ranking-card strong {
    display: block;
    font-size: calc(24px + var(--interface-font-delta));
    font-variant-numeric: tabular-nums;
}

.stats-primary-grid .accent strong,
.ranking-card:nth-child(2) strong {
    color: #c90016;
}

.ranking-card small {
    display: block;
    margin-top: 4px;
    color: #666;
}

.stats-table-wrap {
    overflow-x: auto;
    border: 1px solid #ddd;
    border-radius: 12px;
}

.stats-table {
    min-width: 700px;
}

.stats-table td,
.stats-table th {
    text-align: left;
}

/* ==========================================
   ADMINISTRACJA UŻYTKOWNIKÓW
   ========================================== */

.admin-user-layout {
    display: grid;
    grid-template-columns: 310px minmax(0, 1fr);
    gap: 18px;
}

.admin-add-user-form {
    display: grid;
    align-self: start;
    gap: 12px;
    padding: 18px;
    background: #f7f7f7;
    border: 1px solid #ddd;
    border-radius: 12px;
}

.admin-add-user-form h3 {
    margin: 0 0 5px;
}

.admin-user-list {
    display: grid;
    gap: 10px;
}

.admin-user-card {
    padding: 14px;
    background: #fff;
    border: 1px solid #ddd;
    border-radius: 12px;
}

.admin-user-card.inactive {
    opacity: 0.62;
}

.admin-user-main p {
    margin: 3px 0 0;
    color: #666;
}

.user-status {
    padding: 5px 8px;
    color: #17632a;
    background: #e9f7ec;
    border-radius: 999px;
    font-size: calc(11px + var(--interface-font-delta));
    font-weight: 800;
}

.admin-user-actions {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 7px;
    margin-top: 12px;
    padding-top: 12px;
    border-top: 1px solid #eee;
}

.admin-user-actions form {
    display: flex;
    gap: 5px;
    margin: 0;
}

.admin-user-actions input {
    width: 140px;
}

.danger-button {
    color: #a00012;
    background: #fff0f2;
    border: 1px solid #e2aeb5;
}

.time-entry-client {
    margin-bottom: 12px;
}

.time-entry-client label {
    display: grid;
    gap: 6px;
    color: #444;
    font-size: calc(12px + var(--interface-font-delta));
    font-weight: 800;
}

.time-entry-client input {
    width: 100%;
    box-sizing: border-box;
}

@media (max-width: 1050px) {
    header {
        align-items: flex-start;
        flex-wrap: wrap;
    }

    header nav {
        order: 3;
        width: 100%;
        flex-basis: 100%;
    }

    .client-detail-header {
        align-items: flex-start;
        flex-direction: column;
    }

    .client-detail-metrics {
        width: 100%;
        min-width: 0;
    }

    .stats-primary-grid,
    .ranking-card-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (max-width: 760px) {
    .page-heading-row,
    .visit-card-header {
        align-items: flex-start;
        flex-direction: column;
    }

    .client-card-stats,
    .client-detail-metrics {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .visit-hours {
        text-align: left;
    }

    .admin-user-layout {
        grid-template-columns: 1fr;
    }

    .admin-user-actions {
        align-items: stretch;
        flex-direction: column;
    }

    .admin-user-actions form,
    .admin-user-actions input,
    .admin-user-actions button {
        width: 100%;
        box-sizing: border-box;
    }
}

@media (max-width: 520px) {
    .stats-primary-grid,
    .ranking-card-grid,
    .client-card-stats,
    .client-detail-metrics {
        grid-template-columns: 1fr;
    }

    .stats-tabs {
        display: grid;
        width: 100%;
        box-sizing: border-box;
    }

    .stats-tabs a {
        text-align: center;
    }
}

.calendar-client-links {
    display: flex;
    flex-wrap: wrap;
    gap: 5px;
}

.calendar-client-links a,
.calendar-client-links span {
    display: inline-flex;
    padding: 4px 8px;
    color: #8f0010;
    background: #fff1f3;
    border: 1px solid #efc5ca;
    border-radius: 999px;
    font-size: calc(12px + var(--interface-font-delta));
    font-weight: 800;
    text-decoration: none;
}

.calendar-client-links a:hover {
    color: #fff;
    background: #c90016;
    border-color: #c90016;
}

.stats-client-link {
    color: #a00012;
    font-weight: 800;
    text-decoration: none;
}

.stats-client-link:hover {
    text-decoration: underline;
}

/* ==========================================
   CLOUDFLARE PAGES / SPA
   ========================================== */

.loading-card {
    min-height: 180px;
    display: grid;
    place-items: center;
    color: #777;
}

nav a.active {
    text-decoration: underline;
    text-underline-offset: 5px;
}

.mobile-nav-toggle {
    display: none;
    padding: 7px 11px;
    color: #c90016;
    background: #fff;
    border-radius: 8px;
    font-size: calc(20px + var(--interface-font-delta));
}

.app-dialog {
    width: min(460px, calc(100vw - 30px));
    padding: 22px;
    border: 0;
    border-radius: 14px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, .3);
}

.app-dialog::backdrop {
    background: rgba(0, 0, 0, .45);
}

.dialog-actions {
    display: flex;
    justify-content: flex-end;
    gap: 10px;
    margin-top: 20px;
}

.calendar-client-link {
    display: inline-flex;
    padding: 4px 8px;
    color: #8e0010;
    background: #fff2f4;
    border: 1px solid #efc7cc;
    border-radius: 999px;
    text-decoration: none;
}

.summary-empty {
    color: #999;
}

.summary-overtime-cell.positive {
    color: #c90016;
    font-weight: 700;
}

.settings-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 14px;
    margin: 15px 0 22px;
}

.settings-grid label {
    display: flex;
    flex-direction: column;
    gap: 7px;
    font-weight: 700;
}

.settings-grid .compact-check {
    flex-direction: row;
    align-items: center;
    font-weight: 600;
}

.backup-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
}

#leave-year-form,
#leave-form {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 12px;
}

.timeline-segment.travel,
.timeline-legend i.travel {
    background: #3f82d4;
}

.timeline-segment.work,
.timeline-legend i.work {
    background: #c90016;
}

.timeline-segment.return,
.timeline-legend i.return {
    background: #e3a11a;
}

.time-entry-notes {
    margin-top: 12px;
}

.time-entry-notes label {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.admin-user-actions > button {
    padding: 8px 12px;
    border: 1px solid #ddd;
    background: #fff;
}

@media (max-width: 1050px) {
    header {
        flex-wrap: wrap;
        gap: 10px;
    }

    .mobile-nav-toggle {
        display: inline-flex;
        margin-left: 0;
    }

    header#app-header .header-account {
        margin-left: auto;
    }

    header nav {
        display: none;
        order: 4;
        width: 100%;
        padding-top: 10px;
        border-top: 1px solid rgba(255, 255, 255, .25);
    }

    header nav.mobile-open {
        display: flex;
        flex-wrap: wrap;
        gap: 10px;
    }

    header nav a {
        margin-left: 0;
        padding: 7px 10px;
    }
}

@media (max-width: 760px) {
    .settings-grid {
        grid-template-columns: 1fr;
    }

    .header-account {
        width: 100%;
        justify-content: flex-end;
    }
}


/* ==========================================
   UPROSZCZONY FORMULARZ DNIA
   ========================================== */

.compact-day-summary {
    grid-template-columns: repeat(2, minmax(150px, 1fr));
}

.single-day-form {
    display: grid;
    gap: 18px;
}

.day-status-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(150px, 1fr));
    gap: 12px;
}

.delegation-option {
    border-color: #c8b7ee;
    background: #f3efff;
}

.single-time-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 16px;
}

.single-time-group {
    display: grid;
    align-content: start;
    gap: 11px;
    min-width: 0;
    padding: 15px;
    border: 1px solid #e3c2c6;
    border-radius: 13px;
    background: #fffafa;
}

.single-time-group legend {
    padding: 0 8px;
    color: #940011;
    font-weight: 800;
}

.single-time-group label:not(.compact-check) {
    display: grid;
    gap: 6px;
    color: #4c4c4c;
    font-size: calc(13px + var(--interface-font-delta));
    font-weight: 700;
}

.single-time-group input[type="time"] {
    width: 100%;
    box-sizing: border-box;
    font-size: calc(16px + var(--interface-font-delta));
}

.auto-time-input:disabled {
    color: #6f6f6f;
    background: #e8e8e8;
    border-color: #c9c9c9;
    opacity: 1;
    cursor: not-allowed;
}

.time-unlock-button {
    justify-self: start;
    padding: 5px 8px;
    color: #8e0010;
    background: transparent;
    border: 1px solid #e3b8bd;
    font-size: calc(11px + var(--interface-font-delta));
    font-weight: 700;
}

.time-unlock-button:hover:not(:disabled) {
    color: #ffffff;
    background: #b40015;
}

.time-unlock-button:disabled {
    opacity: .45;
    cursor: not-allowed;
}

.next-day-option {
    margin-top: 2px;
}

.remote-under-hours {
    max-width: 540px;
    margin-top: 18px;
    padding: 15px;
    border: 1px solid #d8d8d8;
    border-radius: 12px;
    background: #f8f8f8;
}

.section-disabled .single-time-grid {
    opacity: .55;
}

.day-editor-actions-complete {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 10px;
    padding-top: 4px;
}

.day-editor-actions-complete .delete-day-button {
    margin-left: auto;
}

/* ==========================================
   KOLOROWE STATYSTYKI
   ========================================== */

.stats-primary-grid-six {
    grid-template-columns: repeat(3, minmax(0, 1fr));
}

.stats-color-card {
    position: relative;
    overflow: hidden;
    min-height: 112px;
    padding: 18px;
    border: 0;
    border-radius: 16px;
    color: #ffffff;
    box-shadow: 0 8px 20px rgba(0, 0, 0, .13);
}

.stats-color-card::after {
    content: "";
    position: absolute;
    right: -24px;
    bottom: -34px;
    width: 105px;
    height: 105px;
    border-radius: 50%;
    background: rgba(255, 255, 255, .13);
}

.stats-color-card span,
.stats-color-card strong {
    position: relative;
    z-index: 1;
    display: block;
}

.stats-color-card span {
    margin-bottom: 9px;
    font-size: calc(12px + var(--interface-font-delta));
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .55px;
    opacity: .9;
}

.stats-color-card strong {
    font-size: calc(29px + var(--interface-font-delta));
}

.stats-color-card.hours { background: linear-gradient(135deg, #c90016, #8f0010); }
.stats-color-card.overtime { background: linear-gradient(135deg, #e86b12, #b23a00); }
.stats-color-card.workdays { background: linear-gradient(135deg, #2475c9, #174f91); }
.stats-color-card.leave { background: linear-gradient(135deg, #21a35b, #14743d); }
.stats-color-card.free { background: linear-gradient(135deg, #607d8b, #3c525c); }
.stats-color-card.delegation { background: linear-gradient(135deg, #7650c8, #4c2d91); }

@media (max-width: 850px) {
    .single-time-grid,
    .stats-primary-grid-six {
        grid-template-columns: 1fr;
    }

    .day-status-grid {
        grid-template-columns: 1fr;
    }

    .day-editor-actions-complete .delete-day-button {
        margin-left: 0;
        width: 100%;
    }
}

tr.delegacja { background: #f1eaff; }


/* ==========================================
   STATYSTYKI — CZYTELNE KAFELKI I WYBÓR OKRESU
   ========================================== */

.stats-page-heading {
    justify-content: center;
    text-align: center;
}

.stats-page-heading h2 {
    margin-bottom: 4px;
    font-size: calc(30px + var(--interface-font-delta));
}

.stats-tabs-wrapper {
    display: flex;
    justify-content: center;
    width: 100%;
}

.stats-period-picker-wrap {
    margin-top: 2px;
    margin-bottom: 24px;
}

.stats-period-main-button .month-picker-main-text {
    font-size: calc(27px + var(--interface-font-delta));
}

.stats-year-picker-wrap .month-side-button-text {
    white-space: normal;
    text-align: center;
}

.stats-picker .lista-lat button.active {
    color: #ffffff;
    background: #c8102e;
    font-weight: 800;
    box-shadow: 0 3px 8px rgba(169, 0, 18, .22);
}

.stats-year-list {
    margin-top: 0;
}

.stats-primary-grid-six {
    gap: 10px;
}

.stats-primary-grid .stats-color-card {
    min-height: 86px;
    padding: 14px 16px;
    border: 0;
    color: #ffffff;
    box-shadow: 0 6px 16px rgba(0, 0, 0, .12);
}

.stats-primary-grid .stats-color-card span {
    margin-bottom: 7px;
    color: #ffffff;
    font-size: calc(14px + var(--interface-font-delta));
    font-weight: 800;
    line-height: 1.15;
    letter-spacing: .45px;
    opacity: 1;
    text-shadow: 0 1px 2px rgba(0, 0, 0, .18);
}

.stats-primary-grid .stats-color-card strong {
    color: #ffffff;
    font-size: calc(33px + var(--interface-font-delta));
    line-height: 1.05;
    font-weight: 800;
    text-shadow: 0 1px 3px rgba(0, 0, 0, .22);
}

.stats-primary-grid .stats-color-card::after {
    right: -30px;
    bottom: -46px;
    width: 100px;
    height: 100px;
}

@media (max-width: 850px) {
    .stats-primary-grid-six {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .stats-period-main-button .month-picker-main-text {
        font-size: calc(23px + var(--interface-font-delta));
    }
}

@media (max-width: 600px) {
    .stats-period-picker-wrap {
        grid-template-columns: 1fr 1fr;
    }

    .stats-period-picker-wrap .month-picker {
        grid-column: 1 / -1;
        grid-row: 1;
    }

    .stats-period-picker-wrap .month-side-button {
        grid-row: 2;
    }

    .stats-page-heading h2 {
        font-size: calc(27px + var(--interface-font-delta));
    }
}

@media (max-width: 420px) {
    .stats-primary-grid-six {
        grid-template-columns: 1fr;
    }
}

/* ==========================================
   STATYSTYKI V2.3 — KOMPAKTOWE KAFELKI I NAWIGACJA
   ========================================== */

/* Sześć małych kafelków w jednym rzędzie na szerokim ekranie. */
.stats-primary-grid-six {
    grid-template-columns: repeat(6, minmax(0, 1fr));
    gap: 8px;
    margin-bottom: 12px;
}

.stats-primary-grid .stats-color-card {
    min-height: 56px;
    padding: 9px 10px;
    border-radius: 11px;
    box-shadow: 0 4px 10px rgba(0, 0, 0, .11);
}

.stats-primary-grid .stats-color-card span {
    margin-bottom: 4px;
    font-size: calc(11px + var(--interface-font-delta));
    line-height: 1.08;
    letter-spacing: .25px;
}

.stats-primary-grid .stats-color-card strong {
    font-size: calc(24px + var(--interface-font-delta));
    line-height: 1;
}

.stats-primary-grid .stats-color-card::after {
    right: -32px;
    bottom: -52px;
    width: 82px;
    height: 82px;
}

/* Mniejszy pasek: poprzedni okres / wybrany okres / następny okres. */
.stats-period-picker-wrap {
    grid-template-columns: 118px minmax(190px, 1fr) 118px;
    gap: 8px;
    max-width: 540px;
    margin: 0 auto 16px;
}

.stats-period-picker-wrap .month-side-button,
.stats-period-picker-wrap .month-picker-main-button {
    min-height: 42px;
    padding: 7px 9px;
    border-radius: 10px;
}

.stats-period-picker-wrap .month-side-button {
    gap: 6px;
}

.stats-period-picker-wrap .month-side-button-icon {
    width: 25px;
    height: 25px;
    font-size: calc(21px + var(--interface-font-delta));
}

.stats-period-picker-wrap .month-side-button-text,
.stats-year-picker-wrap .month-side-button-text {
    font-size: calc(12px + var(--interface-font-delta));
    line-height: 1.05;
    white-space: normal;
    text-align: center;
}

.stats-period-main-button {
    gap: 8px;
}

.stats-period-main-button .month-picker-main-icon {
    font-size: calc(19px + var(--interface-font-delta));
}

.stats-period-main-button .month-picker-main-text {
    font-size: calc(18px + var(--interface-font-delta));
}

/* Kompaktowy minikalendarz statystyk. */
.stats-picker {
    width: 280px;
    padding: 11px;
}

.stats-picker .picker-header,
.stats-picker .lata-naglowek {
    font-size: calc(16px + var(--interface-font-delta));
}

.stats-picker .miesiace {
    gap: 6px;
    margin-top: 9px;
}

.stats-picker .miesiace a {
    padding: 8px 4px;
    font-size: calc(12px + var(--interface-font-delta));
}

.stats-picker .lista-lat {
    gap: 6px;
}

.stats-picker .lista-lat button {
    padding: 8px 4px;
    font-size: calc(12px + var(--interface-font-delta));
}

@media (max-width: 1050px) {
    .stats-primary-grid-six {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }
}

@media (max-width: 700px) {
    .stats-period-picker-wrap {
        grid-template-columns: 1fr 1fr;
        max-width: 100%;
        gap: 7px;
    }

    .stats-period-picker-wrap .month-picker {
        grid-column: 1 / -1;
        grid-row: 1;
    }

    .stats-period-picker-wrap .month-side-button {
        grid-row: 2;
        min-height: 38px;
        padding: 6px 8px;
    }

    .stats-period-picker-wrap .month-picker-main-button {
        min-height: 42px;
    }
}

@media (max-width: 600px) {
    .stats-primary-grid-six {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 7px;
    }

    .stats-primary-grid .stats-color-card {
        min-height: 52px;
        padding: 8px 9px;
    }

    .stats-primary-grid .stats-color-card span {
        font-size: calc(10px + var(--interface-font-delta));
    }

    .stats-primary-grid .stats-color-card strong {
        font-size: calc(22px + var(--interface-font-delta));
    }

    .stats-period-main-button .month-picker-main-text {
        font-size: calc(17px + var(--interface-font-delta));
    }
}

@media (max-width: 420px) {
    .stats-primary-grid-six {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .stats-period-picker-wrap .month-side-button-text,
    .stats-year-picker-wrap .month-side-button-text {
        font-size: calc(11px + var(--interface-font-delta));
    }
}


/* ==========================================
   WERSJA V2.4 — UŻYTKOWNICY, USTAWIENIA I WYKRESY
   ========================================== */

.header-home-link {
    display: inline-flex;
    align-items: center;
    gap: 12px;
}

.header-canon-logo {
    display: block;
    width: 112px;
    height: auto;
}

.header-home-link > span {
    font-size: calc(21px + var(--interface-font-delta));
    font-weight: 800;
    white-space: nowrap;
}

.header-user-name {
    color: #fff;
    font-size: calc(14px + var(--interface-font-delta));
    font-weight: 800;
    white-space: nowrap;
}

.auth-brand {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    margin-bottom: 17px;
    padding: 12px 16px;
    color: #fff;
    background: #c90016;
    border-radius: 12px;
}

.auth-brand img {
    width: 116px;
    height: auto;
}

.auth-brand span {
    font-size: calc(21px + var(--interface-font-delta));
    font-weight: 800;
}

/* Drugie, informacyjne kafelki statystyk są również kompaktowe. */
.ranking-card-grid-compact {
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 8px;
    margin-bottom: 12px;
}

.ranking-card-grid-compact .ranking-card {
    min-height: 54px;
    padding: 9px 11px;
    border-radius: 10px;
}

.ranking-card-grid-compact .ranking-card > span {
    margin-bottom: 3px;
    font-size: calc(9px + var(--interface-font-delta));
    line-height: 1.05;
}

.ranking-card-grid-compact .ranking-card strong {
    font-size: calc(20px + var(--interface-font-delta));
    line-height: 1;
}

.ranking-card-grid-compact .ranking-card small {
    margin-top: 3px;
    font-size: calc(11px + var(--interface-font-delta));
}

.stats-chart-card {
    margin: 14px 0;
    padding: 14px;
    border: 1px solid #dedede;
    border-radius: 12px;
    background: #fff;
}

.stats-chart-heading {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 16px;
    margin-bottom: 8px;
}

.stats-chart-heading h3 {
    margin: 0 0 3px;
    color: #8e0010;
    font-size: calc(17px + var(--interface-font-delta));
}

.stats-chart-heading p {
    margin: 0;
    color: #777;
    font-size: calc(12px + var(--interface-font-delta));
}

.stats-chart-legend {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    font-size: calc(12px + var(--interface-font-delta));
    font-weight: 700;
}

.stats-chart-legend span {
    display: inline-flex;
    align-items: center;
    gap: 5px;
}

.stats-chart-legend i {
    width: 11px;
    height: 11px;
    border-radius: 2px;
}

.stats-chart-legend i.total,
.stats-chart-bar.total { fill: #c90016; background: #c90016; }
.stats-chart-legend i.overtime,
.stats-chart-bar.overtime { fill: #e86b12; background: #e86b12; }

.stats-chart-scroll {
    overflow-x: auto;
    padding-bottom: 3px;
}

.stats-chart {
    display: block;
    width: max(100%, 820px);
    height: 270px;
}

.stats-chart-grid-line { stroke: #e8e8e8; stroke-width: 1; }
.stats-chart-axis { stroke: #aaa; stroke-width: 1; }
.stats-chart-axis-label { fill: #666; font-size: calc(10px + var(--interface-font-delta)); font-family: Arial, sans-serif; }
.stats-chart-bar { transition: opacity .15s ease; }
.stats-chart-bar:hover { opacity: .72; }

.settings-profile-form,
.settings-password-form,
.settings-leave-form {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr)) auto;
    align-items: end;
    gap: 13px;
}

.settings-profile-form label,
.settings-password-form label,
.settings-leave-form label {
    display: grid;
    gap: 6px;
    font-weight: 700;
}

.settings-password-form {
    grid-template-columns: repeat(3, minmax(0, 1fr)) auto;
}

.norms-table {
    max-width: 680px;
    margin-bottom: 20px;
}

.norms-table input {
    width: 82px;
    box-sizing: border-box;
    font-size: calc(17px + var(--interface-font-delta));
    font-weight: 700;
    text-align: center;
}

.settings-counting-options {
    display: flex;
    flex-wrap: wrap;
    gap: 14px 28px;
    margin: 14px 0 18px;
}

.settings-large-check {
    display: inline-flex;
    align-items: center;
    gap: 9px;
    font-size: calc(17px + var(--interface-font-delta));
    font-weight: 700;
}

.settings-large-check input {
    width: 20px;
    height: 20px;
}

.settings-save-button {
    font-size: calc(16px + var(--interface-font-delta));
}

.settings-year-form {
    display: flex;
    align-items: center;
    gap: 8px;
}

.settings-year-form input {
    width: 90px;
}

.leave-auto-note {
    margin-top: 12px;
}

.initial-password-info {
    display: grid;
    gap: 4px;
    padding: 11px 12px;
    color: #5c4400;
    background: #fff7d5;
    border: 1px solid #ecd47c;
    border-radius: 9px;
}

.initial-password-info span,
.initial-password-info small { font-size: calc(12px + var(--interface-font-delta)); }
.initial-password-info strong { font-size: calc(21px + var(--interface-font-delta)); letter-spacing: 1px; }

.admin-user-actions {
    align-items: center;
}

.export-picker-wrap {
    display: flex;
    justify-content: center;
    margin: 20px 0 18px;
}

.export-picker-wrap .month-picker {
    width: min(100%, 360px);
}

.export-period-main-button {
    width: 100%;
    min-width: 0;
}

.export-picker .lista-lat button.active {
    color: #fff;
    background: #c8102e;
}

.export-submit-button {
    display: block;
    min-height: 44px;
    margin: 0 auto;
    padding: 10px 18px;
    font-size: calc(15px + var(--interface-font-delta));
}

@media (max-width: 900px) {
    .ranking-card-grid-compact { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .settings-password-form { grid-template-columns: 1fr 1fr; }
    .settings-password-form button { grid-column: 1 / -1; }
}

@media (max-width: 700px) {
    .header-canon-logo { width: 88px; }
    .header-home-link > span { font-size: calc(16px + var(--interface-font-delta)); }
    .header-user-name { max-width: 65vw; overflow: hidden; text-overflow: ellipsis; }
    .stats-chart-heading { flex-direction: column; }
    .settings-profile-form,
    .settings-password-form,
    .settings-leave-form { grid-template-columns: 1fr; }
    .settings-password-form button { grid-column: auto; }
    .settings-year-form { width: 100%; }
    .settings-year-form input { flex: 1; }
}

@media (max-width: 430px) {
    .ranking-card-grid-compact { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 6px; }
    .ranking-card-grid-compact .ranking-card { padding: 8px; }
    .ranking-card-grid-compact .ranking-card strong { font-size: calc(18px + var(--interface-font-delta)); }
    .auth-brand { gap: 8px; }
    .auth-brand img { width: 92px; }
    .auth-brand span { font-size: calc(17px + var(--interface-font-delta)); }
}

/* ==========================================
   WERSJA V2.5 — IMPORT / EKSPORT EXCEL
   ========================================== */
.excel-import-card code {
    padding: 2px 6px;
    border-radius: 5px;
    background: #f3f3f3;
    font-size: .94em;
}

.excel-import-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 42px;
}

.header-canon-logo,
.auth-brand img {
    object-fit: contain;
}


/* ==========================================
   WERSJA V2.6 — LOGO, KAFELKOWE MENU I INSTALACJA PWA
   ========================================== */
.header-canon-logo {
    width: 122px;
    height: 27px;
    object-fit: contain;
    object-position: left center;
    flex: 0 0 auto;
}

.auth-brand img {
    width: 128px;
    height: 29px;
    object-fit: contain;
}

header nav {
    gap: 7px;
}

header nav .nav-tile {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    min-height: 38px;
    margin: 0;
    padding: 6px 10px;
    color: #fff;
    background: rgba(255, 255, 255, .12);
    border: 1px solid rgba(255, 255, 255, .28);
    border-radius: 10px;
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, .08);
    text-decoration: none;
    transition: background .15s ease, transform .15s ease, border-color .15s ease;
}

header nav .users-nav-tile {
    position: relative;
    overflow: visible;
}

.nav-notification-badge {
    position: absolute;
    top: -9px;
    right: -9px;
    z-index: 3;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 22px;
    height: 22px;
    padding: 0 5px;
    box-sizing: border-box;
    color: #fff;
    background: #ff1738;
    border: 2px solid #fff;
    border-radius: 999px;
    box-shadow: 0 3px 8px rgba(70, 0, 10, .38);
    font-size: calc(10px + var(--interface-font-delta));
    font-weight: 900;
    line-height: 1;
    pointer-events: none;
    animation: nav-notification-pop .24s ease-out;
}

@keyframes nav-notification-pop {
    from { opacity: 0; transform: scale(.55); }
    to { opacity: 1; transform: scale(1); }
}

header nav .nav-tile:hover {
    color: #fff;
    background: rgba(255, 255, 255, .23);
    border-color: rgba(255, 255, 255, .5);
    text-decoration: none;
    transform: translateY(-1px);
}

header nav .nav-tile.active {
    color: #a60014;
    background: #fff;
    border-color: #fff;
    text-decoration: none;
    box-shadow: 0 3px 9px rgba(85, 0, 10, .2);
}

.nav-tile-icon {
    display: grid;
    place-items: center;
    width: 24px;
    height: 24px;
    flex: 0 0 24px;
    font-size: calc(18px + var(--interface-font-delta));
    line-height: 1;
}

.nav-tile-label {
    font-size: calc(12px + var(--interface-font-delta));
    font-weight: 800;
    white-space: nowrap;
}

.install-app-button {
    min-height: 44px;
    font-size: calc(15px + var(--interface-font-delta));
}

.install-app-button:disabled {
    cursor: default;
    opacity: .72;
}

@media (max-width: 1180px) {
    .nav-tile-label { font-size: calc(11px + var(--interface-font-delta)); }
    header nav .nav-tile { padding: 6px 8px; }
}

@media (max-width: 1050px) {
    header nav.mobile-open {
        display: grid;
        grid-template-columns: repeat(3, minmax(0, 1fr));
        align-items: stretch;
    }
    header nav .nav-tile {
        justify-content: flex-start;
        width: auto;
        min-height: 46px;
        padding: 8px 10px;
    }
    .nav-tile-label { font-size: calc(13px + var(--interface-font-delta)); }
    .nav-notification-badge { top: -7px; right: -7px; }
}

@media (max-width: 620px) {
    .header-canon-logo { width: 99px; height: 22px; }
    .header-home-link > span { font-size: calc(15px + var(--interface-font-delta)); }
    header nav.mobile-open { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 390px) {
    .header-home-link { gap: 7px; }
    .header-canon-logo { width: 86px; height: 20px; }
    .header-home-link > span { font-size: calc(14px + var(--interface-font-delta)); }
}

/* ==========================================
   V2.10 — EKSPORT MIESIĄCA Z KALENDARZA
   ========================================== */
.calendar-view-switch-wrapper {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr);
    align-items: center;
    gap: 14px;
    width: 100%;
}

.calendar-view-switch-spacer {
    min-width: 0;
}

.calendar-view-switch {
    justify-self: center;
}

.calendar-export-button {
    justify-self: end;
    display: inline-flex;
    align-items: center;
    gap: 9px;
    min-height: 54px;
    padding: 8px 13px;
    color: #ffffff;
    background: linear-gradient(135deg, #2f8f4e, #176b35);
    border: 1px solid #145d2e;
    border-radius: 11px;
    box-shadow: 0 4px 10px rgba(23, 107, 53, 0.22);
    cursor: pointer;
    transition: transform .15s ease, box-shadow .15s ease, background .15s ease, opacity .15s ease;
}

.calendar-export-button:hover:not(:disabled) {
    background: linear-gradient(135deg, #39a45c, #1d7a3e);
    transform: translateY(-1px);
    box-shadow: 0 6px 14px rgba(23, 107, 53, 0.28);
}

.calendar-export-button:disabled {
    cursor: wait;
    opacity: .65;
}

.calendar-export-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    flex: 0 0 32px;
    color: #176b35;
    background: #ffffff;
    border-radius: 8px;
    font-size: calc(18px + var(--interface-font-delta));
}

.calendar-export-text {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    line-height: 1.12;
    white-space: nowrap;
}

.calendar-export-text small {
    margin-bottom: 2px;
    font-size: calc(9px + var(--interface-font-delta));
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .55px;
    opacity: .86;
}

.calendar-export-text strong {
    font-size: calc(13px + var(--interface-font-delta));
    font-weight: 800;
}

@media (max-width: 900px) {
    .calendar-view-switch-wrapper {
        grid-template-columns: 1fr;
        gap: 9px;
    }

    .calendar-view-switch-spacer {
        display: none;
    }

    .calendar-view-switch {
        justify-self: stretch;
        margin-bottom: 0;
    }

    .calendar-export-button {
        justify-self: end;
        min-height: 46px;
        padding: 6px 10px;
    }
}

@media (max-width: 600px) {
    .calendar-export-icon {
        width: 28px;
        height: 28px;
        flex-basis: 28px;
        font-size: calc(16px + var(--interface-font-delta));
    }

    .calendar-export-text strong {
        font-size: calc(12px + var(--interface-font-delta));
    }
}

/* Wyrównanie wiersza przełącznika i eksportu */
.calendar-view-switch-wrapper {
    margin: 0 0 18px;
}

.calendar-view-switch-wrapper .calendar-view-switch {
    margin: 0;
}

/* Loginy automatyczne */
.auth-secondary-link {
  display: inline-flex;
  justify-content: center;
  margin-top: 16px;
  color: #a90012;
  font-weight: 700;
  text-decoration: none;
}
.auth-secondary-link:hover { text-decoration: underline; }
.generated-login-preview {
  display: flex;
  flex-direction: column;
  gap: 5px;
  padding: 12px 14px;
  border: 1px solid #edc5ca;
  border-radius: 9px;
  background: #fff7f8;
}
.generated-login-preview span { color: #6b6b6b; font-size: calc(13px + var(--interface-font-delta)); }
.generated-login-preview strong { color: #a90012; font-size: calc(18px + var(--interface-font-delta)); overflow-wrap: anywhere; }
@media (max-width: 700px) {
  .settings-profile-card .settings-profile-form { grid-template-columns: 1fr; }
}


/* V2.13 — kompaktowe podsumowania i role administracyjne */
.period-summary {
    max-width: 780px;
    margin-bottom: 16px;
}
.period-summary-grid,
.period-summary-grid.week-summary-grid {
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 8px;
    max-width: 780px;
}
.period-summary-grid .summary-tile,
.period-summary-grid .summary-tile:last-child {
    grid-column: auto !important;
    min-height: 58px;
    padding: 9px 11px;
    gap: 3px;
    border-top-width: 3px;
    border-radius: 9px;
}
.period-summary-grid .summary-tile span {
    font-size: calc(10px + var(--interface-font-delta));
    line-height: 1.15;
    letter-spacing: .25px;
}
.period-summary-grid .summary-tile strong {
    font-size: calc(20px + var(--interface-font-delta));
    line-height: 1.05;
}
.summary-weekday-cell.worked-special-day {
    color: #c90016 !important;
    font-weight: 900;
}
.lata-naglowek {
    justify-content: center;
}
.helper-admin-info p {
    margin: 0;
    color: #555;
    line-height: 1.5;
}
.primary-admin-card {
    border-color: #d6b35d;
    box-shadow: 0 3px 12px rgba(165, 115, 0, .12);
}
@media (max-width: 700px) {
    .period-summary-grid,
    .period-summary-grid.week-summary-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
        gap: 7px;
    }
    .period-summary-grid .summary-tile,
    .period-summary-grid .summary-tile:last-child {
        grid-column: auto !important;
        min-height: 52px;
        padding: 8px 9px;
    }
    .period-summary-grid .summary-tile span {
        font-size: calc(9px + var(--interface-font-delta));
    }
    .period-summary-grid .summary-tile strong {
        font-size: calc(18px + var(--interface-font-delta));
    }
}
@media (max-width: 480px) {
    .period-summary-grid,
    .period-summary-grid.week-summary-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
    }
}


/* V2.13 — tabela urlopów przewijana wewnątrz karty na telefonie */
.leave-page {
    min-width: 0;
    overflow: hidden;
}

.leave-table-wrap {
    display: block;
    width: 100%;
    max-width: 100%;
    overflow-x: auto;
    overflow-y: hidden;
    -webkit-overflow-scrolling: touch;
    overscroll-behavior-inline: contain;
    box-sizing: border-box;
    border-radius: 8px;
}

.leave-table-wrap:focus-visible {
    outline: 2px solid #c90016;
    outline-offset: 2px;
}

.leave-summary-table {
    width: 100%;
    min-width: 620px;
    margin: 0;
}

.leave-summary-table th,
.leave-summary-table td {
    white-space: nowrap;
}

@media (max-width: 600px) {
    .leave-table-wrap {
        scrollbar-width: thin;
    }

    .leave-summary-table {
        width: 620px;
        min-width: 620px;
    }

    .leave-summary-table th,
    .leave-summary-table td {
        padding: 9px 10px;
        font-size: calc(14px + var(--interface-font-delta));
    }
}


/* V2.14 — wybór roku urlopowego jak w statystykach rocznych */
.leave-year-picker-wrap {
  margin-top: 4px;
  margin-bottom: 20px;
}
.leave-year-picker-wrap .lista-lat button.active {
  color: #fff;
  background: #c90016;
  font-weight: 700;
}


/* V2.16 — nowa kolorystyka kalendarza */
tr.weekend,
.day-row.weekend:not(.urlop):not(.wolne):not(.swieto),
.summary-day-row.weekend:not(.urlop):not(.wolne):not(.swieto) {
    background: #fff3bd;
}

tr.urlop,
.day-row.urlop,
.summary-day-row.urlop {
    background: #e1f0c2;
}

.calendar-leave-label {
    color: #355f22;
    font-weight: 800;
}

/* V2.19 — delegacja w statystykach i dotykowe etykiety wykresów */
.stats-color-card.delegation {
    color: #4c2d91;
    background: #f1eaff;
    border: 1px solid #d8c8f3;
    box-shadow: 0 8px 20px rgba(76, 45, 145, .12);
}

.stats-color-card.delegation::after {
    background: rgba(118, 80, 200, .10);
}

.stats-table tr.delegacja:not(.urlop):not(.wolne),
.stats-table td.delegacja {
    background: #f1eaff;
}

.stats-table td.delegacja {
    color: #4c2d91;
    font-weight: 800;
}

.stats-chart-card {
    position: relative;
}

.stats-chart-bar {
    cursor: pointer;
    outline: none;
    touch-action: manipulation;
}

.stats-chart-bar:hover,
.stats-chart-bar:focus,
.stats-chart-bar.active {
    opacity: .68;
    filter: drop-shadow(0 1px 2px rgba(0, 0, 0, .25));
}

.stats-chart-tooltip {
    position: absolute;
    z-index: 20;
    min-width: 150px;
    max-width: min(240px, calc(100% - 16px));
    padding: 8px 11px;
    border: 1px solid rgba(0, 0, 0, .08);
    border-radius: 9px;
    color: #fff;
    background: rgba(35, 35, 35, .94);
    box-shadow: 0 7px 20px rgba(0, 0, 0, .24);
    text-align: center;
    pointer-events: none;
    transform: translateX(-50%);
}

.stats-chart-tooltip[hidden] {
    display: none;
}

.stats-chart-tooltip strong,
.stats-chart-tooltip span {
    display: block;
}

.stats-chart-tooltip strong {
    margin-bottom: 2px;
    font-size: calc(12px + var(--interface-font-delta));
}

.stats-chart-tooltip span {
    font-size: calc(13px + var(--interface-font-delta));
    font-weight: 800;
}

@media (max-width: 600px) {
    .stats-chart-tooltip {
        min-width: 138px;
        padding: 7px 9px;
    }
}


/* V2.20 — formularz dnia: kolory statusów, kompaktowy układ mobilny i podsumowanie na dole */
.day-status-grid .status-option-large {
    width: 100%;
    min-width: 0;
    margin: 0;
    box-sizing: border-box;
    font-weight: 800;
}

.day-status-grid .leave-option {
    color: #355f22;
    background: #e1f0c2;
    border-color: #bfd88c;
}

.day-status-grid .free-option {
    color: #245779;
    background: #cfe8ff;
    border-color: #9bcaf2;
}

.day-status-grid .delegation-option {
    color: #4c2d91;
    background: #f1eaff;
    border-color: #c8b7ee;
}

.day-status-grid .leave-option input { accent-color: #5e8b32; }
.day-status-grid .free-option input { accent-color: #3d86bd; }
.day-status-grid .delegation-option input { accent-color: #7650c8; }

.single-time-pair {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
    min-width: 0;
}

.single-time-pair label {
    min-width: 0;
}

.single-time-pair input[type="time"] {
    min-width: 0;
    box-sizing: border-box;
}

.day-editor-bottom-summary {
    width: 100%;
    min-width: 0;
    margin-top: 0;
}

@media (max-width: 850px) {
    .day-status-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 8px;
    }

    .day-status-grid .status-option-large {
        min-height: 42px;
        padding: 8px 9px;
        font-size: calc(13px + var(--interface-font-delta));
    }

    .single-time-grid {
        grid-template-columns: 1fr;
    }

    .single-time-group {
        padding: 12px;
    }

    .single-time-pair {
        gap: 8px;
    }

    .single-time-pair label {
        font-size: calc(12px + var(--interface-font-delta));
    }

    .single-time-pair input[type="time"] {
        padding-right: 3px;
        padding-left: 3px;
        font-size: calc(15px + var(--interface-font-delta));
    }
}

@media (max-width: 700px) {
    .day-editor-summary.day-editor-bottom-summary {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 8px;
    }

    .day-editor-bottom-summary > div {
        padding: 10px 8px;
    }

    .day-editor-bottom-summary strong {
        font-size: calc(19px + var(--interface-font-delta));
    }
}

@media (max-width: 380px) {
    .day-status-grid .status-option-large {
        padding: 7px;
        font-size: calc(12px + var(--interface-font-delta));
    }

    .single-time-group {
        padding-right: 9px;
        padding-left: 9px;
    }

    .single-time-pair {
        gap: 6px;
    }

    .single-time-pair label {
        font-size: calc(11px + var(--interface-font-delta));
    }

    .single-time-pair input[type="time"] {
        font-size: calc(14px + var(--interface-font-delta));
    }
}


/* V2.21 — obecność użytkowników */
.admin-user-details {
    flex: 1 1 auto;
    min-width: 0;
}

.user-status {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    max-width: min(48%, 245px);
    margin-left: auto;
    white-space: nowrap;
    text-align: center;
}

.user-status::before {
    width: 7px;
    height: 7px;
    flex: 0 0 7px;
    background: currentColor;
    border-radius: 50%;
    content: "";
}

.user-status.presence-online {
    color: #17632a;
    background: #e4f6e9;
    box-shadow: inset 0 0 0 1px #bce2c6;
}

.user-status.presence-offline {
    color: #5f6873;
    background: #eef1f4;
    box-shadow: inset 0 0 0 1px #dce1e6;
}

.user-status.presence-disabled {
    color: #9b2637;
    background: #fae9ec;
    box-shadow: inset 0 0 0 1px #efc6cd;
}

@media (max-width: 560px) {
    .admin-user-main {
        display: grid;
        grid-template-columns: 42px minmax(0, 1fr);
        align-items: center;
    }

    .admin-user-main .user-status {
        grid-column: 2;
        justify-self: start;
        max-width: 100%;
        margin: 7px 0 0;
        white-space: normal;
        text-align: left;
    }
}


/* V2.22 — kompaktowa nawigacja kalendarza i mobilny formularz dnia */
.calendar-overview-card .month-picker-wrap,
.calendar-overview-card .week-navigation {
    grid-template-columns: 118px minmax(190px, 1fr) 118px;
    gap: 8px;
    max-width: 540px;
    margin: 0 auto 14px;
}

.calendar-overview-card .month-side-button,
.calendar-overview-card .week-button,
.calendar-overview-card .month-picker-main-button,
.calendar-overview-card .week-range {
    min-height: 42px;
}

.calendar-overview-card .month-side-button,
.calendar-overview-card .week-button {
    gap: 6px;
    padding: 7px 9px;
    border-radius: 10px;
}

.calendar-overview-card .month-side-button-icon,
.calendar-overview-card .week-button-icon {
    width: 25px;
    height: 25px;
    flex: 0 0 25px;
    font-size: calc(21px + var(--interface-font-delta));
}

.calendar-overview-card .month-side-button-text,
.calendar-overview-card .week-button-label {
    font-size: calc(12px + var(--interface-font-delta));
    line-height: 1.05;
    font-weight: 700;
    white-space: nowrap;
    text-align: center;
}

.calendar-overview-card .week-button-label {
    flex: 1 1 auto;
}

.calendar-overview-card .month-picker-main-button {
    gap: 8px;
    min-width: 0;
    padding: 7px 9px;
    border-radius: 10px;
}

.calendar-overview-card .month-picker-main-icon {
    font-size: calc(19px + var(--interface-font-delta));
}

.calendar-overview-card .month-picker-main-text {
    font-size: calc(18px + var(--interface-font-delta));
}

.calendar-overview-card .week-range {
    padding: 7px 9px;
    border-radius: 10px;
    font-size: calc(14px + var(--interface-font-delta));
}

.calendar-overview-card .week-range span {
    margin: 0 5px;
}

.calendar-view-switch-wrapper.week-mode {
    display: flex;
    justify-content: center;
    grid-template-columns: none;
}

.calendar-view-switch-wrapper.week-mode .calendar-view-switch {
    justify-self: auto;
}

@media (max-width: 700px) {
    .calendar-overview-card .month-picker-wrap,
    .calendar-overview-card .week-navigation {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 7px;
        width: 100%;
        max-width: 100%;
        margin-bottom: 11px;
    }

    .calendar-overview-card .month-picker,
    .calendar-overview-card .week-range {
        grid-column: 1 / -1;
        grid-row: 1;
    }

    .calendar-overview-card .month-side-button,
    .calendar-overview-card .week-button {
        grid-row: 2;
        min-height: 38px;
        padding: 6px 8px;
    }

    .calendar-overview-card .month-picker-main-button,
    .calendar-overview-card .week-range {
        min-height: 42px;
    }

    .calendar-overview-card .month-picker-main-button {
        padding: 7px 9px;
    }

    .calendar-overview-card .month-picker-main-text {
        font-size: calc(17px + var(--interface-font-delta));
    }

    .calendar-overview-card .month-picker-main-icon {
        font-size: calc(18px + var(--interface-font-delta));
    }

    .calendar-overview-card .month-side-button-icon,
    .calendar-overview-card .week-button-icon {
        width: 23px;
        height: 23px;
        flex-basis: 23px;
        font-size: calc(19px + var(--interface-font-delta));
    }

    .calendar-overview-card .month-side-button-text,
    .calendar-overview-card .week-button-label {
        font-size: calc(11px + var(--interface-font-delta));
    }

    .calendar-overview-card .week-range {
        font-size: calc(13px + var(--interface-font-delta));
    }

    .calendar-view-switch-wrapper.week-mode {
        display: flex;
        gap: 0;
    }

    .day-editor-topbar {
        margin-bottom: 7px;
    }

    .day-editor-page .back-to-calendar-button {
        gap: 5px;
        padding: 7px 10px;
        border-radius: 8px;
        font-size: calc(13px + var(--interface-font-delta));
    }

    .day-editor-card {
        padding: 10px;
        border-radius: 10px;
    }

    .day-editor-header {
        gap: 8px;
        margin-bottom: 12px;
        padding-bottom: 11px;
    }

    .day-editor-eyebrow {
        margin-bottom: 3px;
        font-size: calc(9px + var(--interface-font-delta));
    }

    .day-editor-header h2 {
        font-size: calc(19px + var(--interface-font-delta));
        line-height: 1.15;
    }

    .day-editor-holiday {
        margin-top: 4px;
        font-size: calc(12px + var(--interface-font-delta));
    }

    .single-day-form,
    .day-editor-form {
        gap: 10px;
    }

    .day-editor-section {
        padding: 11px;
        border-radius: 10px;
    }

    .section-heading,
    .section-heading-with-action {
        gap: 5px;
        margin-bottom: 10px;
    }

    .section-heading > div {
        gap: 8px;
    }

    .section-number {
        width: 24px;
        height: 24px;
        font-size: calc(11px + var(--interface-font-delta));
    }

    .section-heading h3 {
        font-size: calc(16px + var(--interface-font-delta));
    }

    .section-heading p {
        padding-left: 32px;
        font-size: calc(11px + var(--interface-font-delta));
        line-height: 1.3;
    }

    .day-status-grid {
        gap: 6px;
    }

    .day-status-grid .status-option-large {
        min-height: 38px;
        padding: 7px 8px;
        border-radius: 8px;
        font-size: calc(12px + var(--interface-font-delta));
    }

    .single-time-grid {
        gap: 9px;
    }

    .single-time-group {
        gap: 7px;
        padding: 9px;
        border-radius: 10px;
    }

    .single-time-group legend {
        padding: 0 6px;
        font-size: calc(13px + var(--interface-font-delta));
    }

    .single-time-pair {
        gap: 6px;
    }

    .single-time-group label:not(.compact-check) {
        gap: 4px;
        font-size: calc(11px + var(--interface-font-delta));
    }

    .single-time-pair input[type="time"] {
        min-height: 38px;
        padding: 5px 2px;
        font-size: calc(14px + var(--interface-font-delta));
    }

    .time-unlock-button {
        padding: 4px 6px;
        border-radius: 6px;
        font-size: calc(10px + var(--interface-font-delta));
    }

    .next-day-option {
        font-size: calc(12px + var(--interface-font-delta));
    }

    .remote-under-hours {
        max-width: none;
        margin-top: 10px;
        padding: 10px;
        border-radius: 9px;
    }

    .remote-time-editor {
        gap: 6px;
        margin-top: 7px;
    }

    .remote-time-editor .remote-duration-field input {
        width: 66px;
        padding: 6px;
    }

    .day-basic-grid {
        gap: 10px;
    }

    .editor-field > label:first-child,
    .field-label {
        margin-bottom: 5px;
        font-size: calc(12px + var(--interface-font-delta));
    }

    .editor-field input[type="text"],
    .editor-field input:not([type]),
    .editor-field textarea,
    .multi-client-input {
        padding: 7px;
        font-size: calc(14px + var(--interface-font-delta));
    }

    .editor-field textarea {
        min-height: 70px;
    }

    .editor-field small {
        margin-top: 4px;
        font-size: calc(11px + var(--interface-font-delta));
        line-height: 1.25;
    }

    .day-editor-summary.day-editor-bottom-summary {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 6px;
    }

    .day-editor-bottom-summary > div {
        padding: 8px 6px;
        border-radius: 8px;
    }

    .day-editor-summary span {
        margin-bottom: 3px;
        font-size: calc(9px + var(--interface-font-delta));
    }

    .day-editor-bottom-summary strong {
        font-size: calc(18px + var(--interface-font-delta));
    }

    .day-editor-actions,
    .day-editor-actions-complete {
        gap: 7px;
        padding-top: 0;
    }

    .save-day-button,
    .secondary-action-button,
    .day-editor-actions-complete .delete-day-button {
        min-height: 40px;
        padding: 9px 11px;
        border-radius: 8px;
        font-size: calc(13px + var(--interface-font-delta));
    }
}

@media (max-width: 380px) {
    .day-editor-card {
        padding: 8px;
    }

    .day-editor-section {
        padding: 9px;
    }

    .single-time-group {
        padding: 8px 7px;
    }

    .single-time-pair {
        gap: 5px;
    }

    .single-time-pair input[type="time"] {
        font-size: calc(13px + var(--interface-font-delta));
    }
}


/* V2.24 — statystyki roczne: neutralna tabela, wykres rodzajów dni i czytelniejsza delegacja */
.stats-color-card.delegation {
    color: #ffffff;
    background: linear-gradient(135deg, #8b68d8, #5b35a7);
    border-color: transparent;
    box-shadow: 0 8px 20px rgba(76, 45, 145, .28);
}

.stats-color-card.delegation::after {
    background: rgba(255, 255, 255, .16);
}

.stats-table-annual tbody tr,
.stats-table-annual tbody td {
    color: inherit;
    background: transparent;
    font-weight: inherit;
}

.stats-chart-legend i.leave-days,
.stats-chart-bar.leave-days {
    fill: #7ca84a;
    background: #7ca84a;
}

.stats-chart-legend i.free-days,
.stats-chart-bar.free-days {
    fill: #4b8fc9;
    background: #4b8fc9;
}

.stats-chart-legend i.delegation-days,
.stats-chart-bar.delegation-days {
    fill: #7650c8;
    background: #7650c8;
}

.stats-day-types-chart {
    min-width: 820px;
}

@media (max-width: 600px) {
    .stats-day-types-chart-card .stats-chart-legend {
        gap: 7px 10px;
        font-size: calc(11px + var(--interface-font-delta));
    }
}


/* V2.25 — przyciski ręcznego odblokowania bezpośrednio pod właściwym polem */
.time-field-with-unlock {
    display: grid;
    align-content: start;
    gap: 5px;
    min-width: 0;
}

.time-field-with-unlock > label {
    min-width: 0;
}

.time-field-with-unlock .time-unlock-button {
    width: 100%;
    max-width: 100%;
    justify-self: stretch;
    white-space: normal;
    line-height: 1.2;
    text-align: center;
}

@media (max-width: 700px) {
    .time-field-with-unlock {
        gap: 4px;
    }

    .time-field-with-unlock .time-unlock-button {
        min-height: 27px;
        padding: 3px 4px;
        font-size: calc(9px + var(--interface-font-delta));
    }
}


/* V2.26 — domyślny rodzaj dnia „Praca” */
.day-status-grid .work-option {
    color: #2f2f2f;
    background: #ffffff;
    border-color: #cfcfcf;
}

.day-status-grid .work-option input {
    accent-color: #b40015;
}

.day-status-grid .status-option-large:has(input:checked) {
    border-width: 2px;
    box-shadow: 0 0 0 2px rgba(0, 0, 0, .06);
}

.day-status-grid .work-option:has(input:checked) {
    border-color: #8d8d8d;
}

.day-status-grid {
    grid-template-columns: repeat(4, minmax(130px, 1fr));
}

@media (max-width: 850px) {
    .day-status-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

/* V2.27 — brak automatycznego wyboru rodzaju dnia w weekend i święto */


/* V2.28 — praca zdalna w urlopie/wolnym i równe pola godzin */
.single-time-pair > label,
.single-time-pair > .time-field-with-unlock {
    width: 100%;
    min-width: 0;
    max-width: 100%;
    box-sizing: border-box;
}

.single-time-pair > label,
.time-field-with-unlock > label {
    align-content: start;
}

.single-time-pair input[type="time"] {
    width: 100%;
    min-width: 0;
    max-width: 100%;
    height: 42px;
    min-height: 42px;
    box-sizing: border-box;
}

.section-disabled .remote-under-hours {
    opacity: 1;
}

@media (max-width: 700px) {
    .single-time-pair input[type="time"] {
        height: 38px;
        min-height: 38px;
    }
}

/* V2.30 — odzyskiwanie hasła i weryfikacja adresu e-mail */
.auth-form-note {
    margin: 14px 0 0;
    color: #666;
    font-size: calc(12px + var(--interface-font-delta));
    line-height: 1.45;
}

.auth-success-panel {
    padding: 14px;
    border: 1px solid #badfc2;
    border-radius: 9px;
    color: #145c25;
    background: #eef9f0;
}

.auth-success-panel strong {
    display: block;
    margin-bottom: 5px;
    font-size: calc(16px + var(--interface-font-delta));
}

.auth-success-panel p {
    margin: 0;
}

.auth-result-button {
    display: inline-flex;
    margin-top: 16px;
    text-decoration: none;
}

.recovery-email-heading {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 16px;
    margin-bottom: 14px;
}

.recovery-email-heading h2 {
    margin-bottom: 5px;
}

.recovery-email-heading p {
    margin: 0;
    color: #666;
}

.email-verification-badge {
    display: inline-flex;
    align-items: center;
    min-height: 27px;
    padding: 5px 10px;
    border-radius: 999px;
    white-space: nowrap;
    font-size: calc(11px + var(--interface-font-delta));
    font-weight: 800;
}

.email-verification-badge.verified {
    color: #17632a;
    background: #e4f6e9;
    box-shadow: inset 0 0 0 1px #bce2c6;
}

.email-verification-badge.unverified {
    color: #8a5200;
    background: #fff3d6;
    box-shadow: inset 0 0 0 1px #edcf8a;
}

.email-verification-actions {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-top: 12px;
}

.email-verification-actions small {
    color: #755100;
}

.admin-user-details small {
    display: block;
    margin-top: 3px;
    color: #6a6a6a;
    line-height: 1.3;
}

@media (max-width: 600px) {
    .recovery-email-heading {
        display: grid;
        gap: 9px;
    }

    .email-verification-badge {
        justify-self: start;
    }

    .email-verification-actions {
        align-items: stretch;
        flex-direction: column;
        gap: 7px;
    }
}

/* V2.32 — zgłoszenia nowych użytkowników */
.auth-secondary-actions {
    display: grid;
    gap: 8px;
    margin-top: 16px;
}
.auth-secondary-actions .auth-secondary-link {
    margin-top: 0;
}
.auth-register-link {
    padding: 10px 14px;
    color: #fff;
    background: #c90016;
    border-radius: 8px;
    text-decoration: none;
}
.auth-register-link:hover {
    color: #fff;
    background: #ab0013;
    text-decoration: none;
}
.registration-request-card {
    max-width: 650px;
}
.registration-name-grid,
.registration-password-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 12px;
}
.registration-request-form .generated-login-preview small {
    color: #666;
    line-height: 1.35;
}
.pending-registration-section {
    margin: 0 0 20px;
    padding: 16px;
    background: #fff8e5;
    border: 1px solid #efd38b;
    border-radius: 12px;
}
.pending-registration-heading {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 12px;
}
.pending-registration-heading h3 {
    margin: 2px 0 0;
}
.pending-registration-count {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 34px;
    height: 34px;
    padding: 0 10px;
    color: #fff;
    background: #c90016;
    border-radius: 999px;
    font-weight: 800;
}
.pending-registration-list {
    display: grid;
    gap: 10px;
}
.pending-registration-card {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: center;
    gap: 14px;
    padding: 14px;
    background: #fff;
    border: 1px solid #e7d19b;
    border-radius: 10px;
}
.pending-registration-main {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    min-width: 0;
}
.pending-registration-main h4 {
    margin: 0 0 5px;
    font-size: calc(17px + var(--interface-font-delta));
}
.pending-registration-main p {
    margin: 2px 0;
    overflow-wrap: anywhere;
}
.pending-registration-main small {
    display: block;
    margin-top: 6px;
    color: #666;
    line-height: 1.4;
}
.pending-registration-main .pending-registration-notification-error {
    padding: 7px 9px;
    color: #8f1520;
    background: #fff0f1;
    border: 1px solid #f0c4c8;
    border-radius: 7px;
}
.pending-registration-actions {
    display: flex;
    flex-wrap: wrap;
    justify-content: flex-end;
    gap: 8px;
}
.pending-registration-actions button {
    min-height: 40px;
    padding: 8px 14px;
}
.pending-registration-empty {
    padding: 13px;
    color: #666;
    background: rgba(255,255,255,.7);
    border-radius: 9px;
    text-align: center;
}

/* V2.37 — wyróżnienie aktualnego dnia w kalendarzu */
.calendar-summary-table .summary-day-row.is-today > td {
    background-image: linear-gradient(rgba(201, 0, 22, .055), rgba(201, 0, 22, .055));
    box-shadow:
        inset 0 2px 0 #c90016,
        inset 0 -2px 0 #c90016;
}
.calendar-summary-table .summary-day-row.is-today > td:first-child {
    box-shadow:
        inset 5px 0 0 #c90016,
        inset 0 2px 0 #c90016,
        inset 0 -2px 0 #c90016;
}
.calendar-summary-table .summary-day-row.is-today > td:last-child {
    box-shadow:
        inset -2px 0 0 #c90016,
        inset 0 2px 0 #c90016,
        inset 0 -2px 0 #c90016;
}
.calendar-summary-table .summary-day-row.is-today:hover > td,
.calendar-summary-table .summary-day-row.is-today:focus-visible > td {
    background-image: linear-gradient(rgba(201, 0, 22, .095), rgba(201, 0, 22, .095));
}
.calendar-today-badge {
    display: inline-flex;
    align-items: center;
    min-height: 20px;
    margin-left: 8px;
    padding: 2px 7px;
    color: #fff;
    background: linear-gradient(135deg, #dd172d, #a90012);
    border-radius: 999px;
    box-shadow: 0 2px 5px rgba(169, 0, 18, .24);
    font-size: calc(9px + var(--interface-font-delta));
    font-weight: 900;
    line-height: 1;
    letter-spacing: .45px;
    text-transform: uppercase;
    vertical-align: middle;
}

/* V2.38 — informacje o aplikacji */
.auth-app-version {
    margin: 18px 0 0;
    color: #8a8a8a;
    font-size: calc(10px + var(--interface-font-delta));
    font-weight: 700;
    letter-spacing: .45px;
    text-align: center;
}
.about-app-card {
    overflow: hidden;
    border: 1px solid #ead7da;
    background: linear-gradient(145deg, #fff 0%, #fff9fa 100%);
}
.about-app-heading {
    display: flex;
    align-items: center;
    gap: 18px;
}
.about-app-logo {
    width: 72px;
    height: 72px;
    flex: 0 0 72px;
    border-radius: 18px;
    box-shadow: 0 7px 18px rgba(169, 0, 18, .2);
}
.about-app-title {
    min-width: 0;
}
.about-app-title h2 {
    margin: 1px 0 4px;
}
.about-app-title p {
    margin: 0;
    color: #626262;
}
.about-app-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 7px;
    margin-top: 11px;
}
.about-app-meta span {
    display: inline-flex;
    align-items: center;
    min-height: 27px;
    padding: 4px 9px;
    color: #6d3037;
    background: #fff;
    border: 1px solid #edcbd0;
    border-radius: 999px;
    font-size: calc(11px + var(--interface-font-delta));
}
.about-app-meta strong {
    margin-left: 4px;
    color: #a00012;
}
.about-app-author {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
    margin-top: 18px;
    padding: 12px 14px;
    color: #6b6b6b;
    background: rgba(255, 255, 255, .78);
    border: 1px solid #eee0e2;
    border-radius: 10px;
}
.about-app-author span {
    font-size: calc(12px + var(--interface-font-delta));
}
.about-app-author strong {
    color: #8f0010;
}
.about-app-details {
    margin-top: 12px;
    padding-top: 12px;
    border-top: 1px solid #eadfe1;
}
.about-app-details summary {
    width: fit-content;
    color: #6a3c42;
    font-size: calc(12px + var(--interface-font-delta));
    font-weight: 800;
    cursor: pointer;
}
.about-app-tech-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 8px;
    margin: 12px 0 0;
}
.about-app-tech-grid > div {
    padding: 10px;
    background: #fff;
    border: 1px solid #eee3e4;
    border-radius: 8px;
}
.about-app-tech-grid dt {
    margin-bottom: 3px;
    color: #858585;
    font-size: calc(9px + var(--interface-font-delta));
    font-weight: 800;
    letter-spacing: .4px;
    text-transform: uppercase;
}
.about-app-tech-grid dd {
    margin: 0;
    color: #454545;
    font-size: calc(12px + var(--interface-font-delta));
    font-weight: 700;
}
.about-app-copyright {
    margin: 14px 0 0;
    color: #999;
    font-size: calc(10px + var(--interface-font-delta));
    text-align: right;
}

/* V2.46 — pełna historia wersji */
.release-history-details {
    margin-top: 16px;
    padding-top: 16px;
}
.release-history-details > summary {
    display: flex;
    width: 100%;
    box-sizing: border-box;
    align-items: center;
    gap: 12px;
    padding: 12px 14px;
    color: #5f3036;
    background: rgba(255, 255, 255, .88);
    border: 1px solid #ead8db;
    border-radius: 12px;
    cursor: pointer;
    list-style: none;
    transition: border-color .18s ease, background .18s ease, box-shadow .18s ease;
    user-select: none;
}
.release-history-details > summary::-webkit-details-marker {
    display: none;
}
.release-history-details > summary:hover,
.release-history-details > summary:focus-visible {
    background: #fff;
    border-color: #d9aeb4;
    box-shadow: 0 5px 14px rgba(112, 31, 42, .08);
    outline: none;
}
.release-history-details > summary::after {
    width: 8px;
    height: 8px;
    flex: 0 0 8px;
    margin-left: 2px;
    border-right: 2px solid #9d3c48;
    border-bottom: 2px solid #9d3c48;
    content: "";
    transform: rotate(45deg) translateY(-2px);
    transition: transform .18s ease;
}
.release-history-details[open] > summary {
    background: #fff;
    border-color: #dfb9be;
}
.release-history-details[open] > summary::after {
    transform: rotate(225deg) translate(-1px, -1px);
}
.release-history-summary-title {
    display: flex;
    min-width: 0;
    align-items: center;
    gap: 11px;
}
.release-history-summary-title svg {
    width: 25px;
    height: 25px;
    flex: 0 0 25px;
    fill: none;
    stroke: #b00014;
    stroke-width: 1.8;
    stroke-linecap: round;
    stroke-linejoin: round;
}
.release-history-summary-title > span {
    display: flex;
    min-width: 0;
    flex-direction: column;
    gap: 2px;
}
.release-history-summary-title strong {
    color: #61131c;
    font-size: calc(13px + var(--interface-font-delta));
}
.release-history-summary-title small {
    overflow: hidden;
    color: #8b7376;
    font-size: calc(10px + var(--interface-font-delta));
    font-weight: 600;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.release-history-count {
    display: inline-flex;
    min-height: 25px;
    margin-left: auto;
    padding: 3px 9px;
    align-items: center;
    justify-content: center;
    color: #8d2632;
    background: #fff1f3;
    border: 1px solid #edcbd0;
    border-radius: 999px;
    font-size: calc(10px + var(--interface-font-delta));
    font-weight: 800;
    white-space: nowrap;
}
.release-history-body {
    margin-top: 10px;
    padding: 13px 13px 3px;
    background: rgba(255, 255, 255, .72);
    border: 1px solid #eee1e3;
    border-radius: 12px;
}
.release-history-legend {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin: 0 0 11px 32px;
}
.release-history-legend span,
.release-kind-badge,
.release-current-badge {
    display: inline-flex;
    min-height: 20px;
    box-sizing: border-box;
    align-items: center;
    padding: 2px 7px;
    border: 1px solid transparent;
    border-radius: 999px;
    font-size: calc(8px + var(--interface-font-delta));
    font-weight: 900;
    letter-spacing: .35px;
    line-height: 1;
    text-transform: uppercase;
    white-space: nowrap;
}
.release-history-legend .new,
.release-kind-badge.new {
    color: #9b0012;
    background: #fff0f2;
    border-color: #efc5ca;
}
.release-history-legend .improvement,
.release-kind-badge.improvement {
    color: #1c568a;
    background: #edf6ff;
    border-color: #c8def2;
}
.release-history-legend .fix,
.release-kind-badge.fix {
    color: #805600;
    background: #fff7dd;
    border-color: #ead8a1;
}
.release-current-badge {
    color: #fff;
    background: linear-gradient(135deg, #db1027, #a40013);
    box-shadow: 0 2px 5px rgba(164, 0, 19, .18);
}
.release-history-list {
    position: relative;
    max-height: min(66vh, 680px);
    margin: 0;
    padding: 0 4px 1px 0;
    overflow: auto;
    list-style: none;
    overscroll-behavior: contain;
    scrollbar-color: #d7b4b9 transparent;
    scrollbar-width: thin;
}
.release-history-list::before {
    position: absolute;
    top: 10px;
    bottom: 18px;
    left: 12px;
    width: 2px;
    background: linear-gradient(#d48b95, #eadbdd);
    border-radius: 2px;
    content: "";
}
.release-history-item {
    position: relative;
    padding: 0 0 10px 34px;
}
.release-history-item::before {
    position: absolute;
    top: 16px;
    left: 7px;
    width: 10px;
    height: 10px;
    box-sizing: border-box;
    background: #fff;
    border: 3px solid #c9959c;
    border-radius: 50%;
    box-shadow: 0 0 0 3px rgba(255, 255, 255, .9);
    content: "";
}
.release-history-item.current::before {
    width: 13px;
    height: 13px;
    top: 14px;
    left: 5.5px;
    background: #c90016;
    border-color: #fff;
    box-shadow: 0 0 0 3px rgba(201, 0, 22, .19);
}
.release-history-item article {
    padding: 11px 12px;
    background: #fff;
    border: 1px solid #eee2e4;
    border-radius: 10px;
    box-shadow: 0 2px 7px rgba(72, 30, 36, .035);
}
.release-history-item.current article {
    background: linear-gradient(135deg, #fff 0%, #fff5f6 100%);
    border-color: #e4a7af;
    box-shadow: 0 4px 12px rgba(156, 0, 18, .08);
}
.release-history-item-header {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 6px;
}
.release-version-number {
    margin-right: 2px;
    color: #65131c;
    font-size: calc(13px + var(--interface-font-delta));
    letter-spacing: .15px;
}
.release-change-list {
    margin: 7px 0 0;
    padding-left: 17px;
    color: #555;
    font-size: calc(11px + var(--interface-font-delta));
    line-height: 1.45;
}
.release-change-list li + li {
    margin-top: 3px;
}
.release-change-list li::marker {
    color: #b23a47;
}
@media (max-width: 600px) {
    .about-app-heading {
        align-items: flex-start;
        gap: 13px;
    }
    .about-app-logo {
        width: 58px;
        height: 58px;
        flex-basis: 58px;
        border-radius: 14px;
    }
    .about-app-meta {
        align-items: flex-start;
        flex-direction: column;
    }
    .about-app-author {
        align-items: flex-start;
        flex-direction: column;
        gap: 3px;
    }
    .about-app-tech-grid {
        grid-template-columns: 1fr;
    }
    .release-history-details > summary {
        gap: 8px;
        padding: 11px;
    }
    .release-history-summary-title {
        gap: 8px;
    }
    .release-history-summary-title svg {
        width: 22px;
        height: 22px;
        flex-basis: 22px;
    }
    .release-history-count {
        min-height: 22px;
        padding: 2px 7px;
        font-size: calc(9px + var(--interface-font-delta));
    }
    .release-history-body {
        padding: 10px 8px 1px;
    }
    .release-history-legend {
        margin-left: 29px;
    }
    .release-history-list {
        max-height: 64vh;
        padding-right: 1px;
    }
    .release-history-list::before {
        left: 10px;
    }
    .release-history-item {
        padding-left: 28px;
    }
    .release-history-item::before {
        left: 5px;
    }
    .release-history-item.current::before {
        left: 3.5px;
    }
    .release-history-item article {
        padding: 10px;
    }
    .release-change-list {
        font-size: calc(10.5px + var(--interface-font-delta));
    }
}

/* V2.42 — bardziej kompaktowa tabela kalendarza na telefonie */
@media (max-width: 700px) {
    .calendar-overview-card {
        padding: 12px;
    }
    .calendar-summary-wrap {
        border-radius: 10px;
        -webkit-overflow-scrolling: touch;
        scrollbar-width: thin;
    }
    .calendar-summary-table {
        width: 700px;
        min-width: 700px;
        table-layout: fixed;
        font-size: calc(12px + var(--interface-font-delta));
    }
    .calendar-summary-table th,
    .calendar-summary-table td {
        box-sizing: border-box;
        padding: 9px 7px;
    }
    .calendar-summary-table th {
        font-size: calc(11px + var(--interface-font-delta));
        line-height: 1.15;
        white-space: normal;
    }
    .calendar-summary-table th:nth-child(1),
    .calendar-summary-table td:nth-child(1) { width: 110px; }
    .calendar-summary-table th:nth-child(2),
    .calendar-summary-table td:nth-child(2) { width: 78px; }
    .calendar-summary-table th:nth-child(3),
    .calendar-summary-table td:nth-child(3) { width: 145px; }
    .calendar-summary-table th:nth-child(4),
    .calendar-summary-table td:nth-child(4) { width: 88px; }
    .calendar-summary-table th:nth-child(5),
    .calendar-summary-table td:nth-child(5) { width: 92px; }
    .calendar-summary-table th:nth-child(6),
    .calendar-summary-table td:nth-child(6) { width: 187px; }
    .summary-date-cell,
    .summary-weekday-cell,
    .summary-hours-cell,
    .summary-overtime-cell {
        min-width: 0;
    }
    .summary-client-cell,
    .summary-notes-cell {
        min-width: 0;
        line-height: 1.25;
    }
    .summary-date-cell small {
        max-width: none;
        margin-top: 3px;
        font-size: calc(9px + var(--interface-font-delta));
    }
    .summary-day-link {
        font-size: calc(12.5px + var(--interface-font-delta));
    }
    .summary-weekday-cell {
        font-size: calc(11.5px + var(--interface-font-delta));
    }
    .summary-hours-cell,
    .summary-overtime-cell {
        font-size: calc(12px + var(--interface-font-delta));
    }
    .summary-hours-cell strong,
    .summary-overtime-cell strong {
        font-size: inherit;
    }
    .summary-notes-cell {
        padding-right: 7px !important;
        font-size: calc(11.5px + var(--interface-font-delta));
    }
    .calendar-client-links {
        gap: 3px;
    }
    .calendar-client-links a,
    .calendar-client-links span {
        padding: 2px 5px;
        font-size: calc(10.5px + var(--interface-font-delta));
    }
    .calendar-today-badge {
        display: flex;
        width: fit-content;
        min-height: 17px;
        margin: 4px 0 0;
        padding: 2px 5px;
        font-size: calc(8px + var(--interface-font-delta));
    }
}

/* V2.43 — mobilne zamknięcie aplikacji bez wylogowania */
.application-closed-wrap {
    display: grid;
    min-height: calc(100dvh - 145px);
    place-items: center;
}

.application-closed-card {
    width: min(480px, 100%);
    margin: 0;
    box-sizing: border-box;
    text-align: center;
}

.application-closed-icon {
    display: inline-grid;
    width: 62px;
    height: 62px;
    margin-bottom: 8px;
    place-items: center;
    color: #fff;
    background: #c90016;
    border-radius: 50%;
    box-shadow: 0 8px 22px rgba(150, 0, 18, .22);
    font-size: calc(31px + var(--interface-font-delta));
    line-height: 1;
}

.application-closed-power-icon {
    width: 34px;
    height: 34px;
    fill: none;
    stroke: currentColor;
    stroke-width: 1.8;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.application-closed-card h2 {
    margin: 8px 0 10px;
}

.application-closed-card p {
    margin: 6px 0;
    color: #555;
    line-height: 1.45;
}

.application-closed-session-note {
    font-size: calc(13px + var(--interface-font-delta));
}

.application-reopen-button {
    min-height: 44px;
    margin-top: 17px;
}

body.app-is-closed .header-home-link {
    pointer-events: none;
}

@media (max-width: 760px) {
    .header-account {
        display: grid;
        grid-template-columns: minmax(0, 1fr) auto auto;
        gap: 8px;
    }
    .header-user-name {
        min-width: 0;
        max-width: none;
        overflow: hidden;
        text-overflow: ellipsis;
    }
    .header-logout-button,
    .header-close-button {
        min-height: 36px;
        padding: 7px 9px;
        font-size: calc(12px + var(--interface-font-delta));
    }
    .header-action-icon {
        width: 16px;
        height: 16px;
        flex-basis: 16px;
    }
    .header-close-button {
        display: inline-flex;
    }
    .application-closed-wrap {
        min-height: calc(100dvh - 130px);
    }
}
@media (max-width: 650px) {
    .registration-name-grid,
    .registration-password-grid {
        grid-template-columns: 1fr;
        gap: 8px;
    }
    .pending-registration-section {
        padding: 12px;
    }
    .pending-registration-card {
        grid-template-columns: 1fr;
        gap: 10px;
        padding: 12px;
    }
    .pending-registration-actions {
        display: grid;
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
    .pending-registration-actions [data-registration-notify] {
        grid-column: 1 / -1;
    }
    .pending-registration-actions button {
        width: 100%;
    }
}

/* V2.47 — wybór motywu i ekran startowy aplikacji mobilnej */
.theme-settings-heading {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 18px;
}

.theme-settings-heading h2 {
    margin: 3px 0 5px;
}

.theme-settings-heading p {
    margin: 0;
    color: #666;
}

.theme-settings-heading > svg {
    width: 36px;
    height: 36px;
    flex: 0 0 36px;
    fill: none;
    stroke: #c90016;
    stroke-width: 1.7;
    stroke-linecap: round;
}

.theme-choice-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 250px));
    gap: 12px;
    margin-top: 18px;
}

.theme-choice {
    position: relative;
    display: grid;
    grid-template-columns: 62px minmax(0, 1fr) 26px;
    align-items: center;
    gap: 12px;
    min-height: 76px;
    box-sizing: border-box;
    padding: 10px 12px;
    background: #fafafa;
    border: 2px solid #e1e1e1;
    border-radius: 13px;
    cursor: pointer;
    transition: border-color .16s ease, background .16s ease, box-shadow .16s ease, transform .16s ease;
}

.theme-choice:hover {
    border-color: #d7a7ad;
    transform: translateY(-1px);
}

.theme-choice.is-selected {
    background: #fff7f8;
    border-color: #c90016;
    box-shadow: 0 4px 13px rgba(169, 0, 18, .11);
}

.theme-choice > input {
    position: absolute;
    width: 1px;
    height: 1px;
    opacity: 0;
    pointer-events: none;
}

.theme-choice:focus-within {
    outline: 3px solid rgba(201, 0, 22, .18);
    outline-offset: 2px;
}

.theme-choice-preview {
    position: relative;
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 5px;
    width: 62px;
    height: 48px;
    box-sizing: border-box;
    padding: 15px 7px 7px;
    overflow: hidden;
    border: 1px solid;
    border-radius: 8px;
    box-shadow: 0 3px 8px rgba(0, 0, 0, .12);
}

.theme-choice-preview i {
    position: absolute;
    top: 0;
    right: 0;
    left: 0;
    height: 9px;
    background: #c90016;
}

.theme-choice-preview b {
    display: block;
    border-radius: 3px;
}

.theme-choice-preview-light {
    background: #f4f4f4;
    border-color: #d8d8d8;
}

.theme-choice-preview-light b {
    background: #fff;
    border: 1px solid #e1e1e1;
}

.theme-choice-preview-dark {
    background: #09090a;
    border-color: #3b3b40;
}

.theme-choice-preview-dark b {
    background: #242427;
    border: 1px solid #44444a;
}

.theme-choice-copy {
    display: grid;
    gap: 3px;
}

.theme-choice-copy strong {
    font-size: calc(15px + var(--interface-font-delta));
}

.theme-choice-copy small {
    color: #777;
    font-size: calc(11px + var(--interface-font-delta));
}

.theme-choice-mark {
    display: grid;
    width: 24px;
    height: 24px;
    place-items: center;
    color: transparent;
    background: #eee;
    border-radius: 50%;
    font-size: calc(14px + var(--interface-font-delta));
    font-weight: 900;
}

.theme-choice.is-selected .theme-choice-mark {
    color: #fff;
    background: #c90016;
}

.theme-selection-status {
    margin: 11px 0 0;
}

.app-splash {
    display: none;
}

html.mobile-app-launch .app-splash {
    position: fixed;
    z-index: 100000;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    box-sizing: border-box;
    padding: max(28px, env(safe-area-inset-top)) 28px max(28px, env(safe-area-inset-bottom));
    background:
        radial-gradient(circle at 50% 38%, rgba(201, 0, 22, .08), transparent 34%),
        #f5f5f5;
    opacity: 1;
    transition: opacity .3s ease, visibility .3s ease;
}

.app-splash.is-leaving {
    visibility: hidden;
    opacity: 0;
}

.app-splash-content {
    display: flex;
    align-items: center;
    flex-direction: column;
    text-align: center;
}

.app-splash-logo {
    width: 104px;
    height: 104px;
    border-radius: 24px;
    box-shadow: 0 13px 32px rgba(131, 0, 16, .22);
    animation: app-splash-logo-in .5s cubic-bezier(.2, .8, .2, 1) both;
}

.app-splash-name {
    margin-top: 21px;
    color: #252525;
    font-size: calc(25px + var(--interface-font-delta));
    font-weight: 800;
    letter-spacing: -.35px;
}

.app-splash-version {
    margin-top: 7px;
    color: #777;
    font-size: calc(12px + var(--interface-font-delta));
    font-weight: 700;
    letter-spacing: .55px;
    text-transform: uppercase;
}

.app-splash-loader {
    width: 42px;
    height: 3px;
    margin-top: 28px;
    overflow: hidden;
    background: #dedede;
    border-radius: 999px;
}

.app-splash-loader::after {
    display: block;
    width: 18px;
    height: 100%;
    background: #c90016;
    border-radius: inherit;
    content: "";
    animation: app-splash-loader 1s ease-in-out infinite;
}

@keyframes app-splash-logo-in {
    from { opacity: 0; transform: scale(.88); }
    to { opacity: 1; transform: scale(1); }
}

@keyframes app-splash-loader {
    from { transform: translateX(-20px); }
    50% { transform: translateX(24px); }
    to { transform: translateX(-20px); }
}

@media (max-width: 560px) {
    .theme-choice-grid {
        grid-template-columns: 1fr;
    }

    .theme-choice {
        grid-template-columns: 58px minmax(0, 1fr) 26px;
    }

    .theme-choice-preview {
        width: 58px;
    }
}

@media (prefers-reduced-motion: reduce) {
    .app-splash-logo,
    .app-splash-loader::after {
        animation: none;
    }
}

/* Ciemny motyw — czarne tło, grafitowe powierzchnie i czerwone akcenty Canon */
html[data-theme="dark"] {
    --dark-bg: #09090a;
    --dark-surface: #171719;
    --dark-surface-raised: #202023;
    --dark-surface-soft: #27272b;
    --dark-border: #3a3a40;
    --dark-border-soft: #303035;
    --dark-table-border: #29292e;
    --dark-table-header-divider: rgba(255, 255, 255, .09);
    --dark-text: #f2f2f3;
    --dark-muted: #b0b0b7;
    --dark-accent: #ff596b;
    --dark-red-soft: #321218;
    --dark-shadow: rgba(0, 0, 0, .48);
}

html[data-theme="dark"] body {
    background: var(--dark-bg);
    color: var(--dark-text);
}

html[data-theme="dark"] header {
    background: linear-gradient(135deg, #c90016, #8f0010);
    box-shadow: 0 2px 12px rgba(0, 0, 0, .34);
}

html[data-theme="dark"] .card,
html[data-theme="dark"] .picker,
html[data-theme="dark"] .app-dialog,
html[data-theme="dark"] .calendar-summary-table,
html[data-theme="dark"] .client-history-card,
html[data-theme="dark"] .admin-user-card,
html[data-theme="dark"] .pending-registration-card,
html[data-theme="dark"] .stats-chart-card {
    color: var(--dark-text);
    background: var(--dark-surface);
    border-color: var(--dark-border);
    box-shadow: 0 3px 13px var(--dark-shadow);
}

html[data-theme="dark"] input,
html[data-theme="dark"] textarea,
html[data-theme="dark"] select {
    color: var(--dark-text);
    background: #101012;
    border-color: #4a4a50;
}

html[data-theme="dark"] input::placeholder,
html[data-theme="dark"] textarea::placeholder {
    color: #85858d;
}

html[data-theme="dark"] input:disabled,
html[data-theme="dark"] input[readonly],
html[data-theme="dark"] textarea:disabled,
html[data-theme="dark"] select:disabled {
    color: #929299;
    background: #242428;
    opacity: 1;
}

html[data-theme="dark"] input[type="checkbox"],
html[data-theme="dark"] input[type="radio"] {
    accent-color: #d8001d;
}

html[data-theme="dark"] :where(table th, table td) {
    border-color: var(--dark-table-border);
}

html[data-theme="dark"] :where(
    .calendar-table-wrap,
    .calendar-summary-wrap,
    .stats-table-wrap
) {
    border-color: var(--dark-table-border);
}

html[data-theme="dark"] .calendar-summary-table th {
    border-right-color: var(--dark-table-header-divider);
}

html[data-theme="dark"] code,
html[data-theme="dark"] .excel-import-card code {
    color: #ffd8dc;
    background: #291217;
    border-color: #62313a;
}

html[data-theme="dark"] :where(
    .theme-settings-heading p,
    .theme-choice-copy small,
    .summary-tile span,
    .work-calendar .clients-cell > small,
    .time-pair label,
    .compact-check,
    .period-summary-heading,
    .summary-weekday-cell,
    .summary-overtime-cell strong,
    .summary-notes-cell,
    .day-editor-summary span,
    .section-heading p,
    .editor-field small,
    .client-card-stats span,
    .client-detail-metrics span,
    .empty-state,
    .empty-timeline,
    .visit-card-header p,
    .visit-hours span,
    .visit-hours small,
    .timeline-axis span,
    .stats-primary-grid span,
    .ranking-card > span,
    .ranking-card small,
    .admin-user-main p,
    .admin-user-details small,
    .loading-card,
    .auth-form-note,
    .recovery-email-heading p,
    .pending-registration-main small,
    .pending-registration-empty,
    .about-app-title p,
    .about-app-author,
    .about-app-tech-grid dt,
    .about-app-copyright,
    .release-history-summary-title small,
    .release-change-list,
    .application-closed-card p,
    .settings-help
) {
    color: var(--dark-muted);
}

html[data-theme="dark"] :where(
    .calendar-week-title,
    .week-range,
    .week-range span,
    .calendar-view-button:hover,
    .calendar-view-icon,
    .summary-tile strong,
    .holiday-name,
    .time-entry-heading,
    .time-entry legend,
    .next-day-check,
    .summary-date-cell small,
    .summary-overtime-cell.has-overtime strong,
    .row-edit-arrow,
    .day-editor-eyebrow,
    .day-editor-holiday,
    .day-editor-summary .overtime strong,
    .auth-eyebrow,
    .page-eyebrow,
    .client-card-arrow,
    .visit-hours strong,
    .visit-edit-link,
    .stats-primary-grid .accent strong,
    .stats-client-link,
    .calendar-client-link,
    .summary-overtime-cell.positive,
    .single-time-group legend,
    .time-unlock-button,
    .stats-chart-heading h3,
    .auth-secondary-link,
    .generated-login-preview strong,
    .about-app-meta strong,
    .about-app-author strong,
    .release-history-summary-title strong,
    .release-version-number
) {
    color: var(--dark-accent);
}

html[data-theme="dark"] :where(
    .month-side-button,
    .week-range,
    .calendar-view-switch,
    .calendar-view-icon,
    .summary-tile,
    .time-entry,
    .time-entry-remove,
    .add-entry-button,
    .client-suggestions,
    .client-suggestions button,
    .delete-day-button,
    .row-edit-arrow,
    .back-to-calendar-button,
    .secondary-action-button,
    .day-editor-summary > div,
    .day-editor-section,
    .status-option-large,
    .day-editor-section .time-entry,
    .client-card-stats > div,
    .client-detail-metrics > div,
    .empty-state,
    .empty-timeline,
    .timeline,
    .stats-tabs,
    .stats-primary-grid article,
    .ranking-card,
    .admin-add-user-form,
    .admin-user-actions > button,
    .single-time-group,
    .remote-under-hours,
    .generated-login-preview,
    .day-status-grid .work-option,
    .pending-registration-empty
) {
    color: var(--dark-text);
    background: var(--dark-surface-raised);
    border-color: var(--dark-border);
}

html[data-theme="dark"] .month-side-button-icon {
    color: var(--dark-accent);
    background: #34131a;
}

html[data-theme="dark"] .miesiace a,
html[data-theme="dark"] .lista-lat button {
    color: var(--dark-text);
    background: var(--dark-surface-soft);
}

html[data-theme="dark"] .miesiace a:hover,
html[data-theme="dark"] .lista-lat button:hover {
    color: #fff;
    background: #b90016;
}

html[data-theme="dark"] .calendar-view-button {
    color: #c8c8ce;
}

html[data-theme="dark"] .calendar-view-button:hover {
    background: #2d2d31;
}

html[data-theme="dark"] .calendar-view-button.active,
html[data-theme="dark"] .calendar-view-button.active:hover,
html[data-theme="dark"] .stats-tabs a.active {
    color: #fff;
    background: linear-gradient(135deg, #d71920, #a90012);
}

html[data-theme="dark"] .calendar-view-button.active .calendar-view-icon {
    color: #a90012;
    background: #fff;
}

html[data-theme="dark"] .summary-day-link,
html[data-theme="dark"] .client-suggestions button,
html[data-theme="dark"] .client-history-card,
html[data-theme="dark"] .client-history-card:hover,
html[data-theme="dark"] .editor-field > label:first-child,
html[data-theme="dark"] .field-label,
html[data-theme="dark"] .single-time-group label:not(.compact-check),
html[data-theme="dark"] .time-entry-client label,
html[data-theme="dark"] .auth-form label,
html[data-theme="dark"] .admin-add-user-form label,
html[data-theme="dark"] .stats-filter-form label {
    color: var(--dark-text);
}

html[data-theme="dark"] .summary-day-row:hover,
html[data-theme="dark"] .summary-day-row:focus-visible,
html[data-theme="dark"] .summary-day-row:active {
    background: #29292d;
}

html[data-theme="dark"] .summary-tile.overtime strong {
    color: #ff9a54;
}

html[data-theme="dark"] .summary-tile.leave strong,
html[data-theme="dark"] .calendar-leave-label {
    color: #98dda8;
}

html[data-theme="dark"] .summary-tile.remaining strong {
    color: #c9b9ff;
}

html[data-theme="dark"] tr.weekend,
html[data-theme="dark"] .day-row.weekend:not(.urlop):not(.wolne):not(.swieto),
html[data-theme="dark"] .summary-day-row.weekend:not(.urlop):not(.wolne):not(.swieto) {
    background: #332c16;
}

html[data-theme="dark"] tr.swieto,
html[data-theme="dark"] .day-row.swieto:not(.urlop):not(.wolne),
html[data-theme="dark"] .summary-day-row.swieto:not(.urlop):not(.wolne) {
    background: #3b181d;
}

html[data-theme="dark"] tr.urlop,
html[data-theme="dark"] .day-row.urlop,
html[data-theme="dark"] .summary-day-row.urlop {
    background: #183522;
}

html[data-theme="dark"] tr.wolne,
html[data-theme="dark"] .day-row.wolne,
html[data-theme="dark"] .summary-day-row.wolne {
    background: #172e43;
}

html[data-theme="dark"] tr.delegacja,
html[data-theme="dark"] .stats-color-card.delegation,
html[data-theme="dark"] .stats-table tr.delegacja:not(.urlop):not(.wolne),
html[data-theme="dark"] .stats-table td.delegacja,
html[data-theme="dark"] .day-status-grid .delegation-option,
html[data-theme="dark"] .delegation-option {
    color: #d8c8ff;
    background: #2b2143;
    border-color: #5d4b87;
}

html[data-theme="dark"] .day-status-grid .work-option,
html[data-theme="dark"] .day-editor-section .time-entry {
    color: var(--dark-text);
    background: var(--dark-surface-raised);
    border-color: var(--dark-border);
}

html[data-theme="dark"] .day-status-grid .leave-option {
    color: #a7e3b5;
    background: #183522;
    border-color: #39734a;
}

html[data-theme="dark"] .day-status-grid .free-option {
    color: #acd9ff;
    background: #172e43;
    border-color: #376384;
}

html[data-theme="dark"] .calendar-summary-table .summary-day-row.is-today > td {
    background-image: linear-gradient(rgba(255, 63, 84, .09), rgba(255, 63, 84, .09));
}

html[data-theme="dark"] .back-to-calendar-button,
html[data-theme="dark"] .secondary-action-button,
html[data-theme="dark"] .delete-day-button,
html[data-theme="dark"] .danger-button,
html[data-theme="dark"] .add-entry-button,
html[data-theme="dark"] .time-entry-remove {
    color: #ff8290;
}

html[data-theme="dark"] .back-to-calendar-button:hover,
html[data-theme="dark"] .secondary-action-button:hover {
    color: #fff;
    background: #3a151c;
    border-color: #8e3440;
}

html[data-theme="dark"] .danger-button,
html[data-theme="dark"] .flash-message.blad,
html[data-theme="dark"] .pending-registration-main .pending-registration-notification-error {
    color: #ff9aa5;
    background: #321218;
    border-color: #6e2b35;
}

html[data-theme="dark"] .flash-message {
    color: var(--dark-text);
    background: #29292d;
    border-color: var(--dark-border);
}

html[data-theme="dark"] .flash-message.sukces,
html[data-theme="dark"] .auth-success-panel,
html[data-theme="dark"] .email-verification-badge.verified,
html[data-theme="dark"] .user-status.presence-online {
    color: #8fdda1;
    background: #183522;
    border-color: #326d41;
}

html[data-theme="dark"] .user-status.presence-offline {
    color: #c2c7cd;
    background: #282d32;
    border-color: #505860;
}

html[data-theme="dark"] .user-status.presence-disabled {
    color: #ff9aa6;
    background: #35191e;
    border-color: #71323c;
}

html[data-theme="dark"] .initial-password-info,
html[data-theme="dark"] .email-verification-badge.unverified,
html[data-theme="dark"] .pending-registration-section {
    color: #f0cf76;
    background: #332b14;
    border-color: #6d5b25;
}

html[data-theme="dark"] .email-verification-actions small {
    color: #e5c86f;
}

html[data-theme="dark"] .calendar-client-links a,
html[data-theme="dark"] .calendar-client-links span,
html[data-theme="dark"] .calendar-client-link,
html[data-theme="dark"] .about-app-meta span,
html[data-theme="dark"] .release-history-count,
html[data-theme="dark"] .release-history-legend .new,
html[data-theme="dark"] .release-kind-badge.new {
    color: #ff9ba6;
    background: #321218;
    border-color: #693039;
}

html[data-theme="dark"] .release-history-legend .improvement,
html[data-theme="dark"] .release-kind-badge.improvement,
html[data-theme="dark"] .free-chip {
    color: #a8d6ff;
    background: #172b3d;
    border-color: #315573;
}

html[data-theme="dark"] .release-history-legend .fix,
html[data-theme="dark"] .release-kind-badge.fix,
html[data-theme="dark"] .leave-chip {
    color: #f0d37f;
    background: #332b14;
    border-color: #6d5b25;
}

html[data-theme="dark"] .stats-chart-grid-line {
    stroke: #34343a;
}

html[data-theme="dark"] .stats-chart-axis {
    stroke: #777780;
}

html[data-theme="dark"] .stats-chart-axis-label {
    fill: #b8b8bf;
}

html[data-theme="dark"] .stats-tabs a {
    color: #c8c8ce;
}

html[data-theme="dark"] .generated-login-preview span,
html[data-theme="dark"] .helper-admin-info p,
html[data-theme="dark"] .registration-request-form .generated-login-preview small,
html[data-theme="dark"] .auth-app-version {
    color: var(--dark-muted);
}

html[data-theme="dark"] .theme-settings-card {
    border-color: #3c2529;
}

html[data-theme="dark"] .theme-settings-heading > svg {
    stroke: var(--dark-accent);
}

html[data-theme="dark"] .theme-choice {
    color: var(--dark-text);
    background: #202023;
    border-color: #3b3b40;
}

html[data-theme="dark"] .theme-choice:hover {
    border-color: #7a424a;
}

html[data-theme="dark"] .theme-choice.is-selected {
    background: #2b151a;
    border-color: #e31a32;
    box-shadow: 0 4px 14px rgba(0, 0, 0, .38);
}

html[data-theme="dark"] .theme-choice-mark {
    background: #3a3a3f;
}

html[data-theme="dark"] .theme-choice-copy small {
    color: var(--dark-muted);
}

html[data-theme="dark"] .mobile-nav-toggle {
    color: #fff;
    background: #1b1b1e;
    border: 1px solid rgba(255, 255, 255, .28);
}

html[data-theme="dark"] header nav .nav-tile.active {
    color: #fff;
    background: rgba(20, 20, 22, .82);
    border-color: rgba(255, 255, 255, .5);
}

html[data-theme="dark"] .header-close-button {
    color: #ff7d8b;
    background: #19191b;
    border-color: #592b32;
}

html[data-theme="dark"] .about-app-card {
    background: linear-gradient(145deg, #19191b 0%, #211316 100%);
    border-color: #4b292f;
}

html[data-theme="dark"] .about-app-meta span,
html[data-theme="dark"] .about-app-author,
html[data-theme="dark"] .about-app-tech-grid > div,
html[data-theme="dark"] .release-history-details > summary,
html[data-theme="dark"] .release-history-body,
html[data-theme="dark"] .release-history-item article {
    background: #202023;
    border-color: #3c3c42;
}

html[data-theme="dark"] .about-app-details,
html[data-theme="dark"] .release-history-details {
    border-color: #403338;
}

html[data-theme="dark"] .about-app-details summary,
html[data-theme="dark"] .about-app-tech-grid dd,
html[data-theme="dark"] .release-history-details > summary,
html[data-theme="dark"] .release-history-summary-title strong {
    color: #f1d6d9;
}

html[data-theme="dark"] .release-history-details > summary:hover,
html[data-theme="dark"] .release-history-details > summary:focus-visible,
html[data-theme="dark"] .release-history-details[open] > summary {
    background: #29292d;
    border-color: #6d4850;
}

html[data-theme="dark"] .release-history-item.current article {
    background: linear-gradient(135deg, #25171a, #2f151b);
    border-color: #8b3b46;
}

html[data-theme="dark"] .release-history-item::before {
    background: #202023;
    box-shadow: 0 0 0 3px #202023;
}

html[data-theme="dark"] .release-history-item.current::before {
    background: #e21a32;
    border-color: #f3f3f3;
    box-shadow: 0 0 0 3px rgba(226, 26, 50, .22);
}

html[data-theme="dark"].mobile-app-launch .app-splash {
    background:
        radial-gradient(circle at 50% 38%, rgba(214, 0, 28, .16), transparent 35%),
        #09090a;
}

html[data-theme="dark"] .app-splash-name {
    color: #f4f4f5;
}

html[data-theme="dark"] .app-splash-version {
    color: #aaaab1;
}

html[data-theme="dark"] .app-splash-loader {
    background: #343439;
}

/* V2.48–V2.53 — stały nagłówek i menu po prawej stronie akcji konta */
@media (max-width: 760px) {
    header#app-header {
        position: sticky;
        top: 0;
        z-index: 1000;
        display: grid;
        grid-template-columns: minmax(0, 1fr) auto auto 45px;
        align-items: center;
        column-gap: 6px;
        row-gap: 5px;
        box-sizing: border-box;
        padding: 7px 10px 8px;
        box-shadow: 0 3px 13px rgba(86, 0, 10, .24);
    }

    header#app-header > h1 {
        grid-row: 1;
        grid-column: 1 / -1;
        line-height: 1;
    }

    header#app-header .header-home-link {
        gap: 7px;
        min-width: 0;
    }

    header#app-header .header-canon-logo {
        width: 82px;
        height: 19px;
    }

    header#app-header .header-home-link > span {
        overflow: hidden;
        font-size: calc(13px + var(--interface-font-delta));
        line-height: 19px;
        text-overflow: ellipsis;
    }

    header#app-header .header-account {
        display: contents;
    }

    header#app-header .header-user-name {
        grid-row: 2;
        grid-column: 1;
        min-width: 0;
        max-width: none;
        padding-left: 1px;
        overflow: hidden;
        font-size: calc(11px + var(--interface-font-delta));
        line-height: 1.15;
        text-overflow: ellipsis;
    }

    header#app-header .mobile-nav-toggle {
        grid-row: 2;
        grid-column: 4;
        position: relative;
        display: inline-flex;
        align-items: center;
        justify-content: center;
        align-self: stretch;
        width: 36px;
        min-height: 32px;
        box-sizing: border-box;
        margin: 0 0 0 9px;
        padding: 3px 7px;
        border: 1px solid rgba(255, 255, 255, .42);
        border-radius: 8px;
        font-size: calc(18px + var(--interface-font-delta));
        line-height: 1;
    }

    header#app-header .mobile-nav-toggle::before {
        position: absolute;
        top: 5px;
        bottom: 5px;
        left: -9px;
        width: 1px;
        background: rgba(255, 255, 255, .52);
        border-radius: 1px;
        content: "";
        pointer-events: none;
    }

    header#app-header .header-logout-button,
    header#app-header .header-close-button {
        align-self: stretch;
        min-height: 32px;
        box-sizing: border-box;
        padding: 5px 8px;
        font-size: calc(11px + var(--interface-font-delta));
        line-height: 1;
    }

    header#app-header .header-logout-button {
        grid-row: 2;
        grid-column: 2;
    }

    header#app-header .header-close-button {
        grid-row: 2;
        grid-column: 3;
    }

    header#app-header .header-action-icon {
        width: 14px;
        height: 14px;
        flex-basis: 14px;
    }

    header#app-header nav {
        position: absolute;
        top: calc(100% + 5px);
        right: 8px;
        left: 8px;
        z-index: 2;
        width: auto;
        max-height: calc(100dvh - 96px);
        box-sizing: border-box;
        margin: 0;
        padding: 7px;
        overflow-y: auto;
        overscroll-behavior: contain;
        background: linear-gradient(145deg, #bc0015, #970011);
        border: 1px solid rgba(255, 255, 255, .28);
        border-radius: 12px;
        box-shadow: 0 10px 27px rgba(73, 0, 9, .35);
    }

    header#app-header nav.mobile-open {
        display: grid;
        grid-template-columns: repeat(2, minmax(0, 1fr));
        align-items: stretch;
        gap: 5px;
    }

    header#app-header nav .nav-tile {
        gap: 6px;
        min-height: 37px;
        padding: 4px 7px;
    }

    header#app-header .nav-tile-icon {
        width: 19px;
        height: 19px;
        flex-basis: 19px;
        font-size: calc(15px + var(--interface-font-delta));
    }

    header#app-header .nav-tile-label {
        font-size: calc(11.5px + var(--interface-font-delta));
        line-height: 1.15;
    }

    header#app-header nav .nav-notification-badge {
        top: -6px;
        right: -5px;
        min-width: 20px;
        height: 20px;
        padding: 0 4px;
        border-width: 1.5px;
        font-size: calc(9.5px + var(--interface-font-delta));
    }

    .container {
        padding-top: 10px;
    }
}

@media (max-width: 360px) {
    header#app-header {
        grid-template-columns: minmax(0, 1fr) auto auto 43px;
        column-gap: 4px;
        padding-right: 7px;
        padding-left: 7px;
    }

    header#app-header .mobile-nav-toggle {
        width: 34px;
    }

    header#app-header .header-logout-button,
    header#app-header .header-close-button {
        gap: 4px;
        padding-right: 6px;
        padding-left: 6px;
        font-size: calc(10.5px + var(--interface-font-delta));
    }
}

/* V2.59 — historia zmian i bezpieczne punkty odzyskiwania */
.flash-message-action {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
}

.flash-message-action span {
    min-width: 0;
}

.flash-message-action button {
    flex: 0 0 auto;
    padding: 6px 11px;
    color: inherit;
    background: rgba(255, 255, 255, .72);
    border: 1px solid currentColor;
}

#confirm-message {
    white-space: pre-line;
}

.day-history-panel,
.restore-points-panel {
    margin-top: 14px;
    border: 1px solid #dedee2;
    border-radius: 11px;
    background: #fafafa;
    overflow: hidden;
}

.day-history-panel > summary,
.restore-points-panel > summary {
    display: flex;
    min-height: 54px;
    padding: 11px 13px;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    box-sizing: border-box;
    cursor: pointer;
    list-style: none;
}

.day-history-panel > summary::-webkit-details-marker,
.restore-points-panel > summary::-webkit-details-marker {
    display: none;
}

.day-history-panel > summary > span:first-child,
.restore-points-panel > summary > span:first-child {
    display: grid;
    min-width: 0;
    gap: 2px;
}

.day-history-panel summary strong,
.restore-points-panel summary strong {
    color: #3c3c42;
    font-size: calc(14px + var(--interface-font-delta));
}

.day-history-panel summary small,
.restore-points-panel summary small {
    color: #73737b;
    font-size: calc(11px + var(--interface-font-delta));
    line-height: 1.3;
}

.day-history-count,
.restore-points-count {
    display: inline-grid;
    width: 28px;
    height: 28px;
    flex: 0 0 28px;
    place-items: center;
    color: #8d0010;
    background: #fff0f2;
    border: 1px solid #efc1c7;
    border-radius: 999px;
    font-size: calc(12px + var(--interface-font-delta));
    font-weight: 800;
}

.day-history-panel > ol,
.restore-points-panel > ol {
    display: grid;
    max-height: 360px;
    margin: 0;
    padding: 0;
    border-top: 1px solid #dedee2;
    list-style: none;
    overflow: auto;
}

.day-history-item,
.restore-point-item {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: center;
    gap: 12px;
    padding: 11px 13px;
    border-bottom: 1px solid #e6e6e9;
}

.day-history-item:last-child,
.restore-point-item:last-child {
    border-bottom: 0;
}

.day-history-copy,
.restore-point-copy {
    display: grid;
    min-width: 0;
    gap: 2px;
}

.day-history-copy strong,
.restore-point-copy strong {
    font-size: calc(12.5px + var(--interface-font-delta));
}

.day-history-copy small,
.restore-point-copy small {
    color: #777780;
    font-size: calc(10.5px + var(--interface-font-delta));
}

.day-history-copy span,
.restore-point-copy span {
    overflow: hidden;
    color: #55555d;
    font-size: calc(11.5px + var(--interface-font-delta));
    line-height: 1.3;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.restore-point-actions {
    display: flex;
    gap: 6px;
}

.restore-points-empty {
    margin: 0;
    padding: 12px 13px;
    color: #777780;
    border-top: 1px solid #dedee2;
    font-size: calc(12px + var(--interface-font-delta));
}

html[data-theme="dark"] .day-history-panel,
html[data-theme="dark"] .restore-points-panel {
    background: #202024;
    border-color: #46464d;
}

html[data-theme="dark"] .day-history-panel summary strong,
html[data-theme="dark"] .restore-points-panel summary strong,
html[data-theme="dark"] .day-history-copy strong,
html[data-theme="dark"] .restore-point-copy strong {
    color: #f1f1f3;
}

html[data-theme="dark"] .day-history-panel summary small,
html[data-theme="dark"] .restore-points-panel summary small,
html[data-theme="dark"] .day-history-copy small,
html[data-theme="dark"] .restore-point-copy small,
html[data-theme="dark"] .day-history-copy span,
html[data-theme="dark"] .restore-point-copy span,
html[data-theme="dark"] .restore-points-empty {
    color: #b9b9c0;
}

html[data-theme="dark"] .day-history-count,
html[data-theme="dark"] .restore-points-count {
    color: #ff9aa5;
    background: #321218;
    border-color: #6e2b35;
}

html[data-theme="dark"] .day-history-panel > ol,
html[data-theme="dark"] .restore-points-panel > ol,
html[data-theme="dark"] .day-history-item,
html[data-theme="dark"] .restore-point-item,
html[data-theme="dark"] .restore-points-empty {
    border-color: #3e3e44;
}

html[data-theme="dark"] .flash-message-action button {
    background: rgba(0, 0, 0, .22);
}

@media (max-width: 700px) {
    .flash-message-action {
        padding: 9px 10px;
        font-size: calc(12px + var(--interface-font-delta));
    }

    .flash-message-action button {
        min-height: 34px;
        padding: 5px 9px;
        font-size: calc(11px + var(--interface-font-delta));
    }

    .day-history-panel,
    .restore-points-panel {
        margin-top: 9px;
        border-radius: 9px;
    }

    .day-history-panel > summary,
    .restore-points-panel > summary {
        min-height: 48px;
        padding: 8px 9px;
    }

    .day-history-panel summary strong,
    .restore-points-panel summary strong {
        font-size: calc(12px + var(--interface-font-delta));
    }

    .day-history-panel summary small,
    .restore-points-panel summary small {
        font-size: calc(9.5px + var(--interface-font-delta));
    }

    .day-history-panel > ol,
    .restore-points-panel > ol {
        max-height: 300px;
    }

    .day-history-item,
    .restore-point-item {
        gap: 7px;
        padding: 8px 9px;
    }

    .day-history-item > button {
        width: auto !important;
        min-height: 34px !important;
        padding: 5px 8px !important;
        font-size: calc(10.5px + var(--interface-font-delta)) !important;
    }

    .restore-point-item {
        grid-template-columns: minmax(0, 1fr);
    }

    .restore-point-actions {
        display: grid;
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .restore-point-actions button {
        width: 100%;
        min-height: 34px;
        padding: 5px 7px;
        font-size: calc(10.5px + var(--interface-font-delta));
    }

    .day-history-copy strong,
    .restore-point-copy strong {
        font-size: calc(11.5px + var(--interface-font-delta));
    }

    .day-history-copy span,
    .restore-point-copy span {
        font-size: calc(10.5px + var(--interface-font-delta));
    }

    .app-dialog #confirm-message {
        max-height: 50vh;
        overflow: auto;
    }
}

/* V2.58 — kopiowanie dnia, saldo czasu i bezpieczna aktualizacja PWA */
.day-copy-panel {
    display: grid;
    grid-template-columns: 38px minmax(0, 1fr) auto auto;
    align-items: center;
    gap: 10px;
    padding: 10px 12px;
    background: #f5f9ff;
    border: 1px solid #cfdff2;
    border-radius: 11px;
}

.day-copy-panel-icon {
    display: grid;
    width: 34px;
    height: 34px;
    place-items: center;
    color: #175b9f;
    background: #e5f0fc;
    border-radius: 9px;
    font-size: calc(20px + var(--interface-font-delta));
    font-weight: 900;
}

.day-copy-panel-copy {
    display: grid;
    min-width: 0;
    gap: 2px;
}

.day-copy-panel-copy strong {
    font-size: calc(13px + var(--interface-font-delta));
}

.day-copy-panel-copy small {
    overflow: hidden;
    color: #66717d;
    font-size: calc(10px + var(--interface-font-delta));
    line-height: 1.25;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.day-copy-clients {
    min-height: 36px;
    margin: 0;
    padding: 6px 9px;
    background: #ffffff;
    border: 1px solid #d7e1ec;
    border-radius: 8px;
    font-size: calc(11px + var(--interface-font-delta));
    white-space: nowrap;
}

.day-copy-panel > .secondary-action-button {
    min-height: 36px;
    margin: 0;
    padding: 7px 12px;
}

.day-editor-summary .balance.positive strong,
.stats-balance-value.positive,
.stats-balance-result.positive strong {
    color: #168347;
}

.day-editor-summary .balance.negative strong,
.stats-balance-value.negative,
.stats-balance-result.negative strong {
    color: #c90016;
}

.day-editor-summary .balance.neutral strong,
.stats-balance-value.neutral,
.stats-balance-result.neutral strong {
    color: #4f5f6d;
}

.stats-balance-panel {
    margin: 0 0 8px;
    padding: 8px;
    background: #f6f8fa;
    border: 1px solid #dfe4e8;
    border-radius: 10px;
}

.stats-balance-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 7px;
}

.stats-balance-grid article {
    min-width: 0;
    padding: 8px 10px;
    background: #ffffff;
    border: 1px solid #e0e4e7;
    border-radius: 8px;
    text-align: center;
}

.stats-balance-grid span {
    display: block;
    margin-bottom: 3px;
    color: #6a737b;
    font-size: calc(9px + var(--interface-font-delta));
    font-weight: 800;
    line-height: 1.05;
    text-transform: uppercase;
    letter-spacing: .2px;
}

.stats-balance-grid strong {
    font-size: calc(20px + var(--interface-font-delta));
    line-height: 1;
    font-variant-numeric: tabular-nums;
}

.stats-balance-panel > p {
    margin: 6px 2px 0;
    color: #68727b;
    font-size: calc(9px + var(--interface-font-delta));
    line-height: 1.25;
    text-align: center;
}

.stats-balance-value {
    font-weight: 900;
    font-variant-numeric: tabular-nums;
}

.app-update-notice {
    position: fixed;
    z-index: 5000;
    right: 14px;
    bottom: max(14px, env(safe-area-inset-bottom));
    display: grid;
    grid-template-columns: 36px minmax(0, 1fr) auto 30px;
    width: min(560px, calc(100vw - 28px));
    box-sizing: border-box;
    align-items: center;
    gap: 10px;
    padding: 10px;
    color: #ffffff;
    background: #20262c;
    border: 1px solid rgba(255, 255, 255, .18);
    border-radius: 12px;
    box-shadow: 0 12px 34px rgba(0, 0, 0, .3);
}

.app-update-icon {
    display: grid;
    width: 34px;
    height: 34px;
    place-items: center;
    color: #ffffff;
    background: #c90016;
    border-radius: 9px;
    font-size: calc(22px + var(--interface-font-delta));
    font-weight: 900;
}

.app-update-copy {
    display: grid;
    min-width: 0;
    gap: 2px;
}

.app-update-copy strong {
    font-size: calc(13px + var(--interface-font-delta));
}

.app-update-copy small {
    color: #d3d8dc;
    font-size: calc(9px + var(--interface-font-delta));
    line-height: 1.25;
}

.app-update-button,
.app-update-dismiss {
    min-height: 34px;
    color: #ffffff;
    background: #c90016;
    border: 0;
    border-radius: 8px;
    font: inherit;
    font-size: calc(11px + var(--interface-font-delta));
    font-weight: 800;
    cursor: pointer;
}

.app-update-button {
    padding: 7px 11px;
}

.app-update-dismiss {
    width: 30px;
    padding: 0;
    color: #dce1e5;
    background: rgba(255, 255, 255, .1);
    font-size: calc(20px + var(--interface-font-delta));
}

html[data-theme="dark"] .day-copy-panel {
    background: #152433;
    border-color: #35536e;
}

html[data-theme="dark"] .day-copy-panel-icon {
    color: #acd9ff;
    background: #213e58;
}

html[data-theme="dark"] .day-copy-panel-copy small {
    color: var(--dark-muted);
}

html[data-theme="dark"] .day-copy-clients,
html[data-theme="dark"] .stats-balance-grid article {
    color: var(--dark-text);
    background: var(--dark-surface-raised);
    border-color: var(--dark-border);
}

html[data-theme="dark"] .stats-balance-panel {
    background: var(--dark-surface);
    border-color: var(--dark-border);
}

html[data-theme="dark"] .stats-balance-grid span,
html[data-theme="dark"] .stats-balance-panel > p {
    color: var(--dark-muted);
}

html[data-theme="dark"] .day-editor-summary .balance.neutral strong,
html[data-theme="dark"] .stats-balance-value.neutral,
html[data-theme="dark"] .stats-balance-result.neutral strong {
    color: #c6d0d8;
}

html[data-theme="dark"] .day-editor-summary .balance.positive strong,
html[data-theme="dark"] .stats-balance-value.positive,
html[data-theme="dark"] .stats-balance-result.positive strong {
    color: #6bd49a;
}

html[data-theme="dark"] .day-editor-summary .balance.negative strong,
html[data-theme="dark"] .stats-balance-value.negative,
html[data-theme="dark"] .stats-balance-result.negative strong {
    color: #ff7584;
}

@media (max-width: 700px) {
    .day-editor-page .day-copy-panel {
        grid-template-columns: 28px minmax(0, 1fr) auto;
        gap: 4px 7px;
        padding: 6px 7px;
        border-radius: 8px;
    }

    .day-editor-page .day-copy-panel-icon {
        grid-row: 1 / 3;
        width: 28px;
        height: 28px;
        border-radius: 7px;
        font-size: calc(17px + var(--interface-font-delta));
    }

    .day-editor-page .day-copy-panel-copy {
        grid-column: 2;
        grid-row: 1;
    }

    .day-editor-page .day-copy-panel-copy strong {
        font-size: calc(11.5px + var(--interface-font-delta));
    }

    .day-editor-page .day-copy-panel-copy small {
        display: none;
    }

    .day-editor-page .day-copy-clients {
        grid-column: 2;
        grid-row: 2;
        min-height: 21px;
        padding: 1px 4px;
        border: 0;
        background: transparent;
        font-size: calc(9.5px + var(--interface-font-delta));
    }

    .day-editor-page .day-copy-clients input {
        width: 13px;
        height: 13px;
        margin: 0;
    }

    .day-editor-page .day-copy-panel > .secondary-action-button {
        grid-column: 3;
        grid-row: 1 / 3;
        min-height: 34px;
        padding: 6px 9px;
        font-size: calc(10.5px + var(--interface-font-delta));
    }

    .day-editor-page .day-editor-summary.day-editor-bottom-summary {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }

    .stats-balance-panel {
        margin-bottom: 7px;
        padding: 5px;
        border-radius: 8px;
    }

    .stats-balance-grid {
        gap: 4px;
    }

    .stats-balance-grid article {
        padding: 6px 3px;
        border-radius: 6px;
    }

    .stats-balance-grid span {
        margin-bottom: 2px;
        font-size: calc(7.5px + var(--interface-font-delta));
    }

    .stats-balance-grid strong {
        font-size: calc(16px + var(--interface-font-delta));
    }

    .stats-balance-panel > p {
        margin-top: 4px;
        font-size: calc(8px + var(--interface-font-delta));
    }

    .stats-mobile-data-metrics {
        grid-template-columns: repeat(3, minmax(0, 1fr));
        row-gap: 6px;
    }

    .app-update-notice {
        right: 7px;
        bottom: max(7px, env(safe-area-inset-bottom));
        grid-template-columns: 30px minmax(0, 1fr) auto 26px;
        width: calc(100vw - 14px);
        gap: 7px;
        padding: 7px;
        border-radius: 10px;
    }

    .app-update-icon {
        width: 30px;
        height: 30px;
        border-radius: 7px;
        font-size: calc(19px + var(--interface-font-delta));
    }

    .app-update-copy strong {
        font-size: calc(11.5px + var(--interface-font-delta));
    }

    .app-update-copy small {
        font-size: calc(8px + var(--interface-font-delta));
    }

    .app-update-button {
        min-height: 32px;
        padding: 5px 8px;
        font-size: calc(9.5px + var(--interface-font-delta));
    }

    .app-update-dismiss {
        width: 26px;
        min-height: 32px;
    }
}

@media (max-width: 360px) {
    .day-editor-page .day-editor-summary span {
        font-size: calc(7.5px + var(--interface-font-delta));
    }

    .day-editor-page .day-editor-bottom-summary strong,
    .stats-balance-grid strong {
        font-size: calc(14px + var(--interface-font-delta));
    }

    .app-update-copy small {
        display: none;
    }
}

/* V2.57 — kompletność miesiąca, szkice formularza i walidacja */
.app-dialog {
    max-height: calc(100dvh - 30px);
    box-sizing: border-box;
    overflow: auto;
}

#confirm-message {
    overflow-wrap: anywhere;
    line-height: 1.45;
}

.calendar-completeness-alert {
    display: grid;
    grid-template-columns: 34px minmax(0, 1fr) auto;
    align-items: center;
    gap: 11px;
    margin: 12px 0;
    padding: 11px 13px;
    color: #6d3900;
    background: #fff3d6;
    border: 1px solid #edb85f;
    border-radius: 10px;
    text-decoration: none;
    box-shadow: 0 2px 7px rgba(154, 87, 0, 0.08);
}

.calendar-completeness-alert:hover,
.calendar-completeness-alert:focus-visible {
    color: #4f2900;
    background: #ffebbd;
    border-color: #db931c;
    outline: none;
}

.calendar-completeness-icon {
    display: grid;
    width: 32px;
    height: 32px;
    place-items: center;
    color: #fff;
    background: #db7c00;
    border-radius: 50%;
    font-size: calc(18px + var(--interface-font-delta));
    font-weight: 900;
}

.calendar-completeness-alert > span:nth-child(2) {
    display: grid;
    min-width: 0;
    gap: 2px;
}

.calendar-completeness-alert strong {
    font-size: calc(14px + var(--interface-font-delta));
}

.calendar-completeness-alert small {
    font-size: calc(11px + var(--interface-font-delta));
    line-height: 1.3;
}

.calendar-completeness-arrow {
    font-size: calc(26px + var(--interface-font-delta));
    line-height: 1;
}

.calendar-summary-table .summary-day-row.missing-entry > td {
    background: #fff7e8;
    border-bottom-color: #f0d8ad;
}

.calendar-summary-table .summary-day-row.missing-entry:hover > td,
.calendar-summary-table .summary-day-row.missing-entry:focus-visible > td {
    background: #ffedcc;
}

.calendar-missing-label {
    color: #a65300;
    font-size: calc(11px + var(--interface-font-delta));
    font-weight: 900;
}

.mobile-month-day.missing-entry,
.mobile-week-day.missing-entry {
    color: #6f3700;
    background: #fff1d2;
    border-color: #e9a83f;
    box-shadow: inset 0 0 0 1px rgba(219, 124, 0, 0.13);
}

.mobile-month-day.missing-entry .mobile-month-day-value,
.mobile-week-day.missing-entry .mobile-week-day-content > span {
    color: #a65300;
    font-weight: 900;
}

.day-draft-notice {
    display: grid;
    grid-template-columns: 30px minmax(0, 1fr) auto;
    align-items: center;
    gap: 10px;
    margin: 0 0 13px;
    padding: 10px 12px;
    color: #205830;
    background: #edf8ef;
    border: 1px solid #a8d7b2;
    border-radius: 9px;
}

.day-draft-notice-icon {
    display: grid;
    width: 28px;
    height: 28px;
    place-items: center;
    color: #fff;
    background: #2f8a48;
    border-radius: 50%;
    font-weight: 900;
}

.day-draft-notice > span:nth-child(2) {
    display: grid;
    min-width: 0;
    gap: 2px;
}

.day-draft-notice strong {
    font-size: calc(13px + var(--interface-font-delta));
}

.day-draft-notice small {
    font-size: calc(10px + var(--interface-font-delta));
    line-height: 1.25;
}

.day-draft-notice .secondary-action-button {
    min-height: 34px;
    margin: 0;
    padding: 6px 10px;
    font-size: calc(11px + var(--interface-font-delta));
}

.day-draft-status {
    margin: -2px 0 0;
    color: #697079;
    font-size: calc(10px + var(--interface-font-delta));
    line-height: 1.25;
    text-align: center;
}

.day-draft-status[data-state="saved"] {
    color: #2e7441;
}

.day-draft-status[data-state="error"] {
    color: #a00012;
    font-weight: 700;
}

html[data-theme="dark"] .calendar-completeness-alert {
    color: #ffdca8;
    background: #362713;
    border-color: #76501e;
    box-shadow: none;
}

html[data-theme="dark"] .calendar-completeness-alert:hover,
html[data-theme="dark"] .calendar-completeness-alert:focus-visible {
    color: #ffe7c2;
    background: #443018;
    border-color: #9a6725;
}

html[data-theme="dark"] .calendar-summary-table .summary-day-row.missing-entry > td {
    background: #302718;
    border-color: #56452a;
}

html[data-theme="dark"] .calendar-summary-table .summary-day-row.missing-entry:hover > td,
html[data-theme="dark"] .calendar-summary-table .summary-day-row.missing-entry:focus-visible > td {
    background: #3b2f1d;
}

html[data-theme="dark"] .calendar-missing-label {
    color: #ffbd63;
}

html[data-theme="dark"] .mobile-month-day.missing-entry,
html[data-theme="dark"] .mobile-week-day.missing-entry {
    color: #ffd9a0;
    background: #382815;
    border-color: #805923;
}

html[data-theme="dark"] .mobile-month-day.missing-entry .mobile-month-day-value,
html[data-theme="dark"] .mobile-week-day.missing-entry .mobile-week-day-content > span {
    color: #ffc46f;
}

html[data-theme="dark"] .day-draft-notice {
    color: #bfe6c7;
    background: #172d1d;
    border-color: #356441;
}

html[data-theme="dark"] .day-draft-status {
    color: var(--dark-muted);
}

html[data-theme="dark"] .day-draft-status[data-state="saved"] {
    color: #8fd2a0;
}

html[data-theme="dark"] .day-draft-status[data-state="error"] {
    color: #ff8a98;
}

@media (max-width: 720px) {
    .calendar-completeness-alert {
        grid-template-columns: 27px minmax(0, 1fr) auto;
        gap: 7px;
        margin: 7px 0;
        padding: 7px 8px;
        border-radius: 8px;
    }

    .calendar-completeness-icon {
        width: 25px;
        height: 25px;
        font-size: calc(14px + var(--interface-font-delta));
    }

    .calendar-completeness-alert strong {
        font-size: calc(11.5px + var(--interface-font-delta));
    }

    .calendar-completeness-alert small {
        font-size: calc(8.5px + var(--interface-font-delta));
        line-height: 1.2;
    }

    .calendar-completeness-arrow {
        font-size: calc(20px + var(--interface-font-delta));
    }

    .day-editor-page .day-draft-notice {
        grid-template-columns: 24px minmax(0, 1fr) auto;
        gap: 6px;
        margin: 0 0 6px;
        padding: 6px 7px;
        border-radius: 7px;
    }

    .day-editor-page .day-draft-notice-icon {
        width: 22px;
        height: 22px;
        font-size: calc(12px + var(--interface-font-delta));
    }

    .day-editor-page .day-draft-notice strong {
        font-size: calc(10.5px + var(--interface-font-delta));
    }

    .day-editor-page .day-draft-notice small {
        font-size: calc(8px + var(--interface-font-delta));
    }

    .day-editor-page .day-draft-notice .secondary-action-button {
        width: auto;
        min-height: 30px;
        padding: 5px 7px;
        font-size: calc(9px + var(--interface-font-delta));
    }

    .day-editor-page .day-draft-status {
        margin-top: -1px;
        font-size: calc(8.5px + var(--interface-font-delta));
    }
}

@media (max-width: 760px) {
    html[data-theme="dark"] header#app-header nav {
        background: linear-gradient(145deg, #38383e 0%, #29292e 100%);
        border-color: #696972;
        box-shadow: 0 14px 34px rgba(0, 0, 0, .72), inset 0 1px 0 rgba(255, 255, 255, .08);
    }

    html[data-theme="dark"] header#app-header nav .nav-tile {
        background: #202024;
        border-color: #505058;
    }

    html[data-theme="dark"] header#app-header nav .nav-tile:hover {
        background: #48484f;
        border-color: #777780;
    }

html[data-theme="dark"] header#app-header nav .nav-tile.active {
        background: #4a1c23;
        border-color: #d05a68;
    }
}

/* V2.52 — zwarty ekran Ustawień na telefonie */
.settings-page {
    display: contents;
}

@media (max-width: 700px) {
    .settings-page {
        display: block;
    }

    .settings-page > .card {
        margin-bottom: 10px;
        padding: 13px;
        border-radius: 9px;
    }

    .settings-page > .card:last-child {
        margin-bottom: 0;
    }

    .settings-page h2 {
        margin: 0 0 9px;
        font-size: calc(17px + var(--interface-font-delta));
        line-height: 1.18;
    }

    .settings-page h3 {
        margin: 12px 0 7px;
        font-size: calc(14px + var(--interface-font-delta));
        line-height: 1.2;
    }

    .settings-page p {
        margin: 5px 0 9px;
        font-size: calc(11.5px + var(--interface-font-delta));
        line-height: 1.35;
    }

    .settings-page .page-eyebrow {
        margin-bottom: 2px;
        font-size: calc(9px + var(--interface-font-delta));
        letter-spacing: .65px;
    }

    .settings-page :where(.settings-profile-form, .settings-password-form, .settings-leave-form) {
        gap: 8px;
    }

    .settings-page :where(.settings-profile-form, .settings-password-form, .settings-leave-form) label {
        min-width: 0;
        gap: 4px;
        font-size: calc(12px + var(--interface-font-delta));
        line-height: 1.18;
    }

    .settings-page :where(input:not([type="checkbox"]):not([type="radio"]), textarea, select) {
        width: 100%;
        min-width: 0;
        min-height: 38px;
        box-sizing: border-box;
        padding: 6px 8px;
        font-size: calc(13.5px + var(--interface-font-delta));
    }

    .settings-page :where(button, .secondary-action-button, .btn-excel) {
        min-height: 38px;
        box-sizing: border-box;
        padding: 7px 10px;
        font-size: calc(12px + var(--interface-font-delta));
        line-height: 1.15;
    }

    .settings-profile-card .settings-profile-form {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .recovery-email-heading {
        gap: 6px;
        margin-bottom: 9px;
    }

    .recovery-email-heading h2 {
        margin-bottom: 3px;
    }

    .email-verification-badge {
        min-height: 22px;
        padding: 3px 8px;
        font-size: calc(9.5px + var(--interface-font-delta));
    }

    .email-verification-actions {
        gap: 6px;
        margin-top: 8px;
    }

    .theme-settings-heading {
        align-items: center;
        gap: 9px;
    }

    .theme-settings-heading h2 {
        margin: 1px 0 3px;
    }

    .theme-settings-heading > svg {
        width: 27px;
        height: 27px;
        flex-basis: 27px;
    }

    .theme-choice-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 7px;
        margin-top: 10px;
    }

    .theme-choice {
        grid-template-columns: 39px minmax(0, 1fr) 18px;
        gap: 6px;
        min-height: 57px;
        padding: 6px;
        border-width: 1px;
        border-radius: 9px;
    }

    .theme-choice-preview {
        width: 39px;
        height: 32px;
        padding: 11px 4px 4px;
        gap: 3px;
        border-radius: 6px;
    }

    .theme-choice-preview i {
        height: 7px;
    }

    .theme-choice-copy {
        gap: 1px;
    }

    .theme-choice-copy strong {
        font-size: calc(12.5px + var(--interface-font-delta));
    }

    .theme-choice-copy small {
        font-size: calc(9px + var(--interface-font-delta));
        line-height: 1.1;
    }

    .theme-choice-mark {
        width: 18px;
        height: 18px;
        font-size: calc(11px + var(--interface-font-delta));
    }

    .theme-selection-status {
        margin: 7px 0 0 !important;
    }

    .norms-table {
        margin-bottom: 11px;
        font-size: calc(12px + var(--interface-font-delta));
    }

    .norms-table th,
    .norms-table td {
        padding: 5px 4px;
    }

    .norms-table input {
        width: 58px;
        min-height: 32px !important;
        padding: 3px 5px !important;
        font-size: calc(14px + var(--interface-font-delta)) !important;
    }

    .settings-counting-options {
        display: grid;
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 6px;
        margin: 8px 0 10px;
    }

    .settings-large-check {
        align-items: flex-start;
        gap: 6px;
        font-size: calc(12px + var(--interface-font-delta));
        line-height: 1.25;
    }

    .settings-large-check input {
        width: 17px;
        height: 17px;
        flex: 0 0 17px;
        margin: 0;
    }

    .settings-save-button {
        width: 100%;
    }

    .leave-correction-card .page-heading-row {
        gap: 6px;
        margin-bottom: 9px;
    }

    .settings-year-form {
        gap: 6px;
    }

    .settings-year-form input {
        width: 0;
        min-width: 0;
        flex: 1 1 0;
    }

    .settings-year-form .secondary-action-button {
        width: auto;
        min-width: 100px;
        flex: 0 0 auto;
    }

    .settings-leave-form {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .settings-leave-form button {
        grid-column: 1 / -1;
    }

    .settings-password-form {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .settings-password-form label:first-child,
    .settings-password-form button {
        grid-column: 1 / -1;
    }

    .settings-help {
        margin: 7px 0 0 !important;
        font-size: calc(10.5px + var(--interface-font-delta)) !important;
        line-height: 1.32 !important;
    }

    .backup-actions {
        display: grid;
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 7px;
    }

    .settings-page .backup-actions > * {
        display: inline-flex;
        width: 100%;
        margin: 0;
        align-items: center;
        justify-content: center;
        text-align: center;
    }

    .excel-import-card .backup-actions,
    .app-install-card .backup-actions {
        grid-template-columns: 1fr;
    }

    .backup-card .backup-actions > :last-child:nth-child(3) {
        grid-column: 1 / -1;
    }

    .excel-import-button,
    .install-app-button {
        margin-bottom: 0;
    }

    .about-app-heading {
        gap: 9px;
    }

    .about-app-logo {
        width: 46px;
        height: 46px;
        flex-basis: 46px;
        border-radius: 11px;
    }

    .about-app-title h2 {
        margin-bottom: 2px;
    }

    .about-app-title p {
        margin: 0;
    }

    .about-app-meta {
        align-items: center;
        flex-direction: row;
        gap: 4px;
        margin-top: 6px;
    }

    .about-app-meta span {
        min-height: 21px;
        padding: 2px 6px;
        font-size: calc(9px + var(--interface-font-delta));
    }

    .about-app-author {
        align-items: center;
        flex-direction: row;
        gap: 8px;
        margin-top: 9px;
        padding: 7px 9px;
    }

    .about-app-author span,
    .about-app-author strong {
        font-size: calc(11px + var(--interface-font-delta));
    }

    .release-history-details {
        margin-top: 9px;
        padding-top: 9px;
    }

    .release-history-details > summary {
        gap: 6px;
        padding: 8px;
        border-radius: 9px;
    }

    .release-history-summary-title {
        gap: 6px;
    }

    .release-history-summary-title svg {
        width: 18px;
        height: 18px;
        flex-basis: 18px;
    }

    .release-history-summary-title strong {
        font-size: calc(12px + var(--interface-font-delta));
    }

    .release-history-summary-title small {
        font-size: calc(9px + var(--interface-font-delta));
    }

    .release-history-count {
        min-height: 20px;
        padding: 2px 6px;
        font-size: calc(8.5px + var(--interface-font-delta));
    }

    .release-history-body {
        margin-top: 7px;
        padding: 8px 7px 1px;
        border-radius: 9px;
    }

    .release-history-legend {
        gap: 4px;
        margin: 0 0 7px 25px;
    }

    .release-history-item {
        padding: 0 0 7px 27px;
    }

    .release-history-item article {
        padding: 8px;
        border-radius: 8px;
    }

    .release-change-list {
        margin-top: 5px;
        font-size: calc(10px + var(--interface-font-delta));
        line-height: 1.35;
    }

    .about-app-details {
        margin-top: 8px;
        padding-top: 8px;
    }

    .about-app-tech-grid {
        grid-template-columns: repeat(3, minmax(0, 1fr));
        gap: 5px;
        margin-top: 7px;
    }

    .about-app-tech-grid > div {
        padding: 6px;
        border-radius: 6px;
    }

    .about-app-tech-grid dt {
        font-size: calc(7.5px + var(--interface-font-delta));
        letter-spacing: .25px;
    }

    .about-app-tech-grid dd {
        font-size: calc(10.5px + var(--interface-font-delta));
    }

    .about-app-copyright {
        margin-top: 8px !important;
    }
}

@media (max-width: 350px) {
    .settings-profile-card .settings-profile-form,
    .settings-password-form {
        grid-template-columns: 1fr;
    }

    .settings-password-form label:first-child,
    .settings-password-form button {
        grid-column: auto;
    }
}

/* V2.53 — zwarte ekrany Użytkowników i Urlopu na telefonie */
.leave-mobile-summary {
    display: none;
}

@media (max-width: 700px) {
    .admin-users-page {
        padding: 12px;
        border-radius: 10px;
    }

    .admin-users-page > .page-heading-row {
        gap: 0;
        margin-bottom: 8px;
    }

    .admin-users-page > .page-heading-row h2 {
        margin: 0;
        font-size: calc(18px + var(--interface-font-delta));
        line-height: 1.15;
    }

    .admin-users-page .page-eyebrow {
        margin-bottom: 2px;
        font-size: calc(9px + var(--interface-font-delta));
        letter-spacing: .65px;
    }

    .pending-registration-section {
        margin-bottom: 10px;
        padding: 9px;
        border-radius: 9px;
    }

    .pending-registration-heading {
        gap: 8px;
        margin-bottom: 8px;
    }

    .pending-registration-heading h3 {
        margin: 1px 0 0;
        font-size: calc(14px + var(--interface-font-delta));
        line-height: 1.18;
    }

    .pending-registration-count {
        min-width: 27px;
        height: 27px;
        padding: 0 7px;
        font-size: calc(12px + var(--interface-font-delta));
    }

    .pending-registration-list {
        gap: 7px;
    }

    .pending-registration-card {
        grid-template-columns: 1fr;
        gap: 8px;
        padding: 9px;
        border-radius: 8px;
    }

    .pending-registration-main {
        gap: 8px;
    }

    .pending-registration-main .client-avatar {
        width: 34px;
        height: 34px;
        border-radius: 9px;
        font-size: calc(16px + var(--interface-font-delta));
    }

    .pending-registration-main h4 {
        margin-bottom: 3px;
        font-size: calc(14px + var(--interface-font-delta));
        line-height: 1.18;
    }

    .pending-registration-main p {
        margin: 1px 0;
        font-size: calc(11px + var(--interface-font-delta));
        line-height: 1.28;
    }

    .pending-registration-main small {
        margin-top: 4px;
        font-size: calc(10px + var(--interface-font-delta));
        line-height: 1.3;
    }

    .pending-registration-main .pending-registration-notification-error {
        padding: 5px 7px;
    }

    .pending-registration-actions {
        display: grid;
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 6px;
    }

    .pending-registration-actions [data-registration-notify] {
        grid-column: 1 / -1;
    }

    .pending-registration-actions button {
        width: 100%;
        min-height: 38px;
        box-sizing: border-box;
        padding: 6px 8px;
        font-size: calc(11.5px + var(--interface-font-delta));
        line-height: 1.15;
    }

    .pending-registration-empty {
        padding: 8px;
        border-radius: 7px;
        font-size: calc(11px + var(--interface-font-delta));
    }

    .admin-user-layout {
        gap: 10px;
    }

    .admin-add-user-form {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 7px;
        padding: 10px;
        border-radius: 9px;
    }

    .admin-add-user-form h3,
    .admin-add-user-form .generated-login-preview,
    .admin-add-user-form .initial-password-info,
    .admin-add-user-form > button {
        grid-column: 1 / -1;
    }

    .admin-add-user-form h3 {
        margin: 0 0 2px;
        font-size: calc(14px + var(--interface-font-delta));
        line-height: 1.18;
    }

    .admin-add-user-form label {
        min-width: 0;
        gap: 3px;
        font-size: calc(11.5px + var(--interface-font-delta));
        line-height: 1.18;
    }

    .admin-add-user-form input {
        width: 100%;
        min-width: 0;
        min-height: 38px;
        box-sizing: border-box;
        padding: 6px 8px;
        font-size: calc(13.5px + var(--interface-font-delta));
    }

    .admin-add-user-form .generated-login-preview {
        gap: 2px;
        padding: 7px 9px;
        border-radius: 7px;
    }

    .admin-add-user-form .generated-login-preview span {
        font-size: calc(10px + var(--interface-font-delta));
        line-height: 1.2;
    }

    .admin-add-user-form .generated-login-preview strong {
        font-size: calc(14.5px + var(--interface-font-delta));
        line-height: 1.15;
    }

    .admin-add-user-form .initial-password-info {
        gap: 2px;
        padding: 7px 9px;
        border-radius: 7px;
    }

    .admin-add-user-form .initial-password-info span,
    .admin-add-user-form .initial-password-info small {
        font-size: calc(10px + var(--interface-font-delta));
        line-height: 1.25;
    }

    .admin-add-user-form .initial-password-info strong {
        font-size: calc(17px + var(--interface-font-delta));
        line-height: 1.1;
    }

    .admin-add-user-form > button {
        min-height: 38px;
        padding: 7px 10px;
        font-size: calc(12px + var(--interface-font-delta));
    }

    .admin-add-user-form.helper-admin-info {
        grid-template-columns: 1fr;
    }

    .admin-add-user-form.helper-admin-info > * {
        grid-column: 1;
    }

    .admin-add-user-form.helper-admin-info p {
        margin: 0;
        font-size: calc(11px + var(--interface-font-delta));
        line-height: 1.35;
    }

    .admin-user-list {
        gap: 7px;
    }

    .admin-user-card {
        padding: 9px;
        border-radius: 9px;
    }

    .admin-user-main {
        display: grid;
        grid-template-columns: 34px minmax(0, 1fr);
        align-items: center;
        gap: 8px;
    }

    .admin-user-main .client-avatar {
        width: 34px;
        height: 34px;
        border-radius: 9px;
        font-size: calc(16px + var(--interface-font-delta));
    }

    .admin-user-main h3 {
        font-size: calc(14px + var(--interface-font-delta));
        line-height: 1.18;
    }

    .admin-user-main p {
        margin-top: 2px;
        font-size: calc(10.5px + var(--interface-font-delta));
        line-height: 1.25;
    }

    .admin-user-details small {
        margin-top: 2px;
        font-size: calc(9.5px + var(--interface-font-delta));
        line-height: 1.25;
    }

    .admin-user-main .user-status {
        grid-column: 2;
        justify-self: start;
        max-width: 100%;
        gap: 5px;
        margin: 5px 0 0;
        padding: 4px 7px;
        font-size: calc(10px + var(--interface-font-delta));
        line-height: 1.15;
        white-space: normal;
        text-align: left;
    }

    .admin-user-main .user-status::before {
        width: 6px;
        height: 6px;
        flex-basis: 6px;
    }

    .admin-user-actions {
        display: grid;
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 6px;
        margin-top: 8px;
        padding-top: 8px;
    }

    .admin-user-actions:empty {
        display: none;
    }

    .admin-user-actions button {
        width: 100%;
        min-height: 38px;
        box-sizing: border-box;
        padding: 6px 7px;
        font-size: calc(11px + var(--interface-font-delta));
        line-height: 1.15;
    }

    .admin-user-actions button:only-child {
        grid-column: 1 / -1;
    }

    .leave-page {
        padding: 13px;
        border-radius: 10px;
    }

    .leave-page > .page-heading-row {
        gap: 0;
        margin-bottom: 8px;
    }

    .leave-page > .page-heading-row h2 {
        margin: 0;
        font-size: calc(18px + var(--interface-font-delta));
        line-height: 1.15;
    }

    .leave-page .page-eyebrow {
        margin-bottom: 2px;
        font-size: calc(9px + var(--interface-font-delta));
        letter-spacing: .65px;
    }

    .leave-year-picker-wrap {
        margin: 0 0 12px;
    }

    .leave-desktop-summary {
        display: none;
    }

    .leave-mobile-summary {
        display: grid;
        gap: 8px;
    }

    .leave-mobile-balance {
        display: flex;
        align-items: center;
        justify-content: space-between;
        gap: 12px;
        min-height: 62px;
        padding: 10px 13px;
        box-sizing: border-box;
        color: #285a35;
        background: linear-gradient(135deg, #eff8e5, #e0f0c2);
        border: 1px solid #b9d68f;
        border-radius: 10px;
    }

    .leave-mobile-balance > span,
    .leave-mobile-metrics span {
        font-size: calc(10px + var(--interface-font-delta));
        font-weight: 800;
        line-height: 1.15;
        text-transform: uppercase;
        letter-spacing: .45px;
    }

    .leave-mobile-balance strong {
        font-size: calc(29px + var(--interface-font-delta));
        line-height: 1;
        font-variant-numeric: tabular-nums;
    }

    .leave-mobile-balance small,
    .leave-mobile-metrics small {
        font-size: .52em;
        font-weight: 800;
    }

    .leave-mobile-metrics {
        display: grid;
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 7px;
    }

    .leave-mobile-metrics article {
        display: grid;
        gap: 5px;
        min-height: 58px;
        padding: 8px 10px;
        box-sizing: border-box;
        background: #f7f7f7;
        border: 1px solid #dedede;
        border-radius: 9px;
    }

    .leave-mobile-metrics span {
        color: #666;
        font-size: calc(9px + var(--interface-font-delta));
    }

    .leave-mobile-metrics strong {
        align-self: end;
        font-size: calc(20px + var(--interface-font-delta));
        line-height: 1;
        font-variant-numeric: tabular-nums;
    }

    .leave-auto-note {
        margin: 9px 1px 0 !important;
        font-size: calc(10.5px + var(--interface-font-delta)) !important;
        line-height: 1.35 !important;
    }

    html[data-theme="dark"] .leave-mobile-balance {
        color: #a9e9b8;
        background: linear-gradient(135deg, #1c3a24, #243f1d);
        border-color: #44764f;
    }

    html[data-theme="dark"] .leave-mobile-metrics article {
        color: var(--dark-text);
        background: var(--dark-surface-raised);
        border-color: var(--dark-border);
    }

html[data-theme="dark"] .leave-mobile-metrics span {
        color: var(--dark-muted);
    }
}

/* V2.54 — zwarty kalendarz i statystyki na telefonie */
.calendar-mobile-view,
.stats-mobile-data-list {
    display: none;
}

.stats-expandable-section {
    display: block;
}

.stats-expandable-section > summary {
    display: none;
}

.stats-expandable-body {
    display: contents;
}

@media (max-width: 700px) {
    .calendar-overview-card {
        padding: 9px;
        border-radius: 10px;
    }

    .calendar-overview-card .month-picker-wrap,
    .calendar-overview-card .week-navigation,
    .stats-period-picker-wrap {
        grid-template-columns: 38px minmax(0, 1fr) 38px;
        gap: 5px;
        width: 100%;
        max-width: 100%;
        margin: 0 0 7px;
    }

    .calendar-overview-card .month-picker,
    .calendar-overview-card .week-range,
    .stats-period-picker-wrap .month-picker {
        grid-row: 1;
        grid-column: 2;
    }

    .calendar-overview-card .month-side-button,
    .calendar-overview-card .week-button,
    .stats-period-picker-wrap .month-side-button {
        grid-row: 1;
        min-height: 36px;
        padding: 4px;
        border-radius: 8px;
    }

    .calendar-overview-card .month-side-button:first-child,
    .calendar-overview-card .week-button:first-child,
    .stats-period-picker-wrap .month-side-button:first-child {
        grid-column: 1;
    }

    .calendar-overview-card .month-side-button-next,
    .calendar-overview-card .week-button-next,
    .stats-period-picker-wrap .month-side-button-next {
        grid-column: 3;
    }

    .calendar-overview-card .month-side-button-text,
    .calendar-overview-card .week-button-label,
    .stats-period-picker-wrap .month-side-button-text {
        display: none;
    }

    .calendar-overview-card .month-side-button-icon,
    .calendar-overview-card .week-button-icon,
    .stats-period-picker-wrap .month-side-button-icon {
        width: 25px;
        height: 25px;
        flex-basis: 25px;
        font-size: calc(21px + var(--interface-font-delta));
    }

    .calendar-overview-card .month-picker-main-button,
    .calendar-overview-card .week-range,
    .stats-period-picker-wrap .month-picker-main-button {
        min-height: 36px;
        padding: 5px 8px;
        border-radius: 8px;
    }

    .calendar-overview-card .month-picker-main-text,
    .stats-period-main-button .month-picker-main-text {
        font-size: calc(14px + var(--interface-font-delta));
    }

    .calendar-overview-card .month-picker-main-icon,
    .stats-period-main-button .month-picker-main-icon {
        font-size: calc(15px + var(--interface-font-delta));
    }

    .calendar-overview-card .week-range {
        font-size: calc(10.5px + var(--interface-font-delta));
    }

    .calendar-overview-card .week-range span {
        margin: 0 3px;
    }

    .calendar-view-switch-wrapper,
    .calendar-view-switch-wrapper.month-mode {
        grid-template-columns: minmax(0, 1fr) 74px;
        gap: 5px;
        margin: 0 0 7px;
    }

    .calendar-view-switch-wrapper.week-mode {
        display: flex;
        margin-bottom: 7px;
    }

    .calendar-view-switch-wrapper .calendar-view-switch {
        display: flex;
        width: 100%;
        min-width: 0;
        box-sizing: border-box;
        gap: 3px;
        padding: 3px;
        border-radius: 9px;
    }

    .calendar-view-button {
        min-width: 0;
        min-height: 34px;
        flex: 1 1 0;
        justify-content: center;
        padding: 5px 4px;
        border-radius: 7px;
    }

    .calendar-view-text small,
    .calendar-view-icon {
        display: none;
    }

    .calendar-view-text strong {
        font-size: calc(10.5px + var(--interface-font-delta));
        line-height: 1.08;
        text-align: center;
    }

    .calendar-export-button {
        display: inline-flex;
        width: 74px;
        min-height: 40px;
        box-sizing: border-box;
        justify-self: stretch;
        justify-content: center;
        gap: 4px;
        padding: 4px 5px;
        border-radius: 8px;
    }

    .calendar-export-button::after {
        font-size: calc(9.5px + var(--interface-font-delta));
        font-weight: 800;
        content: "Excel";
    }

    .calendar-export-icon {
        width: 22px;
        height: 22px;
        flex-basis: 22px;
        border-radius: 6px;
        font-size: calc(13px + var(--interface-font-delta));
    }

    .calendar-export-text {
        display: none;
    }

    .period-summary {
        margin: 0 auto 7px;
    }

    .period-summary-heading {
        display: none;
    }

    .period-summary-grid,
    .period-summary-grid.week-summary-grid {
        grid-template-columns: repeat(4, minmax(0, 1fr)) !important;
        gap: 4px;
        max-width: none;
    }

    .period-summary-grid .summary-tile,
    .period-summary-grid .summary-tile:last-child {
        min-height: 45px;
        box-sizing: border-box;
        padding: 5px 3px;
        gap: 2px;
        border-top-width: 2px;
        border-radius: 7px;
        text-align: center;
    }

    .period-summary-grid .summary-tile span {
        font-size: calc(7.5px + var(--interface-font-delta));
        line-height: 1.05;
        letter-spacing: .05px;
    }

    .period-summary-grid .summary-tile strong {
        font-size: calc(16px + var(--interface-font-delta));
        line-height: 1;
    }

    .calendar-desktop-summary {
        display: none;
    }

    .calendar-mobile-view {
        display: grid;
    }

    .mobile-month-calendar {
        gap: 4px;
        padding: 6px;
        background: #f7f7f7;
        border: 1px solid #dedede;
        border-radius: 9px;
    }

    .mobile-calendar-weekdays,
    .mobile-calendar-days {
        display: grid;
        grid-template-columns: repeat(7, minmax(0, 1fr));
        gap: 3px;
    }

    .mobile-calendar-weekdays span {
        padding: 1px 0 2px;
        color: #777;
        font-size: calc(8px + var(--interface-font-delta));
        font-weight: 900;
        line-height: 1;
        text-align: center;
        text-transform: uppercase;
    }

    .mobile-month-day-placeholder {
        min-height: 49px;
    }

    .mobile-month-day {
        position: relative;
        display: flex;
        min-width: 0;
        min-height: 49px;
        box-sizing: border-box;
        flex-direction: column;
        justify-content: space-between;
        padding: 4px;
        overflow: hidden;
        color: #333;
        background: #fff;
        border: 1px solid #dedede;
        border-radius: 7px;
        text-decoration: none;
    }

    .mobile-month-day-top {
        display: flex;
        min-width: 0;
        align-items: center;
        justify-content: space-between;
        gap: 2px;
        line-height: 1;
    }

    .mobile-month-day-top strong {
        font-size: calc(12px + var(--interface-font-delta));
        font-variant-numeric: tabular-nums;
    }

    .mobile-month-day-top i {
        color: #b00014;
        font-size: calc(6.5px + var(--interface-font-delta));
        font-style: normal;
        font-weight: 900;
        letter-spacing: -.1px;
        text-transform: uppercase;
    }

    .mobile-month-day-value {
        overflow: hidden;
        font-size: calc(8px + var(--interface-font-delta));
        font-weight: 800;
        line-height: 1;
        text-align: center;
        text-overflow: ellipsis;
        white-space: nowrap;
    }

    .mobile-month-day > small {
        overflow: hidden;
        color: #b94700;
        font-size: calc(6.5px + var(--interface-font-delta));
        font-weight: 900;
        line-height: 1;
        text-align: center;
        text-overflow: ellipsis;
        white-space: nowrap;
    }

    .mobile-month-day.weekend,
    .mobile-week-day.weekend {
        background: #fff3bd;
        border-color: #ead47d;
    }

    .mobile-month-day.swieto,
    .mobile-week-day.swieto {
        background: #ffe1e1;
        border-color: #e9aaaa;
    }

    .mobile-month-day.urlop,
    .mobile-week-day.urlop {
        background: #e1f0c2;
        border-color: #b9d68f;
    }

    .mobile-month-day.wolne,
    .mobile-week-day.wolne {
        background: #dceeff;
        border-color: #a9cee9;
    }

    .mobile-month-day.delegacja,
    .mobile-week-day.delegacja {
        background: #f1eaff;
        border-color: #d3c2ef;
    }

    .mobile-month-day.is-today,
    .mobile-week-day.is-today {
        border-color: #c90016;
        box-shadow: inset 0 0 0 1.5px #c90016;
    }

    .mobile-calendar-hint {
        margin: 2px 0 0;
        color: #777;
        font-size: calc(8.5px + var(--interface-font-delta));
        line-height: 1.2;
        text-align: center;
    }

    .mobile-week-calendar {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 5px;
    }

    .mobile-week-day {
        position: relative;
        display: grid;
        min-width: 0;
        min-height: 61px;
        box-sizing: border-box;
        gap: 5px;
        padding: 7px;
        overflow: hidden;
        color: #333;
        background: #fff;
        border: 1px solid #dedede;
        border-radius: 8px;
        text-decoration: none;
    }

    .mobile-week-day-heading,
    .mobile-week-day-content {
        display: flex;
        min-width: 0;
        align-items: center;
        gap: 5px;
    }

    .mobile-week-day-heading strong {
        font-size: calc(12px + var(--interface-font-delta));
        font-variant-numeric: tabular-nums;
    }

    .mobile-week-day-heading > span {
        overflow: hidden;
        color: #666;
        font-size: calc(9px + var(--interface-font-delta));
        font-weight: 700;
        text-overflow: ellipsis;
        white-space: nowrap;
    }

    .mobile-week-day-heading i {
        margin-left: auto;
        color: #b00014;
        font-size: calc(7px + var(--interface-font-delta));
        font-style: normal;
        font-weight: 900;
        text-transform: uppercase;
    }

    .mobile-week-day-content > span {
        min-width: 0;
        flex: 1;
        overflow: hidden;
        font-size: calc(9px + var(--interface-font-delta));
        font-weight: 650;
        text-overflow: ellipsis;
        white-space: nowrap;
    }

    .mobile-week-day-content > strong {
        flex: 0 0 auto;
        color: #8f0010;
        font-size: calc(15px + var(--interface-font-delta));
        line-height: 1;
        font-variant-numeric: tabular-nums;
    }

    .mobile-week-day > small {
        margin-top: -3px;
        color: #b94700;
        font-size: calc(8px + var(--interface-font-delta));
        font-weight: 800;
        line-height: 1;
        text-align: right;
    }

    .stats-page {
        padding: 10px;
        overflow: hidden;
        border-radius: 10px;
    }

    .stats-page-heading {
        margin-bottom: 6px;
    }

    .stats-page-heading h2 {
        margin: 0;
        font-size: calc(18px + var(--interface-font-delta));
        line-height: 1.1;
    }

    .stats-page-heading .page-eyebrow {
        margin-bottom: 1px;
        font-size: calc(8px + var(--interface-font-delta));
        letter-spacing: .55px;
    }

    .stats-tabs {
        display: grid;
        grid-template-columns: repeat(2, minmax(0, 1fr));
        width: 100%;
        box-sizing: border-box;
        gap: 3px;
        margin-bottom: 7px;
        padding: 3px;
        border-radius: 9px;
    }

    .stats-tabs a {
        padding: 6px 8px;
        border-radius: 7px;
        font-size: calc(11px + var(--interface-font-delta));
        line-height: 1.1;
        text-align: center;
    }

    .stats-primary-grid-six {
        grid-template-columns: repeat(3, minmax(0, 1fr)) !important;
        gap: 5px;
        margin-bottom: 7px;
    }

    .stats-primary-grid .stats-color-card {
        min-height: 47px;
        box-sizing: border-box;
        justify-content: center;
        padding: 6px 7px;
        border-radius: 8px;
    }

    .stats-primary-grid .stats-color-card span {
        margin-bottom: 3px;
        font-size: calc(7.5px + var(--interface-font-delta));
        line-height: 1.08;
        letter-spacing: .05px;
    }

    .stats-primary-grid .stats-color-card strong {
        font-size: calc(18px + var(--interface-font-delta));
        line-height: 1;
    }

    .stats-expandable-section {
        display: block;
        margin-top: 6px;
        background: #f7f7f7;
        border: 1px solid #dedede;
        border-radius: 9px;
    }

    .stats-expandable-section > summary {
        display: flex;
        min-height: 39px;
        box-sizing: border-box;
        align-items: center;
        gap: 8px;
        padding: 6px 9px;
        cursor: pointer;
        list-style: none;
        user-select: none;
    }

    .stats-expandable-section > summary::-webkit-details-marker {
        display: none;
    }

    .stats-expandable-icon {
        display: grid;
        width: 25px;
        height: 25px;
        flex: 0 0 25px;
        place-items: center;
        color: #a90012;
        background: #fff;
        border: 1px solid #e7c5c9;
        border-radius: 7px;
        font-size: calc(13px + var(--interface-font-delta));
        font-weight: 900;
    }

    .stats-expandable-copy {
        display: grid;
        min-width: 0;
        flex: 1;
        gap: 1px;
    }

    .stats-expandable-copy strong {
        font-size: calc(11.5px + var(--interface-font-delta));
        line-height: 1.1;
    }

    .stats-expandable-copy small {
        overflow: hidden;
        color: #777;
        font-size: calc(8.5px + var(--interface-font-delta));
        line-height: 1.1;
        text-overflow: ellipsis;
        white-space: nowrap;
    }

    .stats-expandable-action {
        width: 8px;
        height: 8px;
        flex: 0 0 8px;
        margin: 0 3px 4px 5px;
        border-right: 2px solid #9a2835;
        border-bottom: 2px solid #9a2835;
        transform: rotate(45deg);
        transition: transform .16s ease;
    }

    .stats-expandable-section[open] .stats-expandable-action {
        margin-bottom: -3px;
        transform: rotate(225deg);
    }

    .stats-expandable-body {
        display: block;
        padding: 7px;
        border-top: 1px solid #e2e2e2;
    }

    .ranking-card-grid-compact {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 5px;
        margin: 0;
    }

    .ranking-card-grid-compact .ranking-card {
        min-height: 48px;
        box-sizing: border-box;
        padding: 7px;
        border-radius: 7px;
    }

    .ranking-card-grid-compact .ranking-card > span {
        font-size: calc(7.5px + var(--interface-font-delta));
    }

    .ranking-card-grid-compact .ranking-card strong {
        font-size: calc(16px + var(--interface-font-delta));
    }

    .ranking-card-grid-compact .ranking-card small {
        font-size: calc(8.5px + var(--interface-font-delta));
    }

    .stats-expandable-body .stats-chart-card {
        margin: 0;
        padding: 6px;
        border: 0;
        border-radius: 7px;
        box-shadow: none;
    }

    .stats-chart-heading {
        gap: 5px;
        margin-bottom: 4px;
    }

    .stats-chart-heading h3 {
        margin: 0;
        font-size: calc(11px + var(--interface-font-delta));
        line-height: 1.2;
    }

    .stats-chart-heading p {
        display: none;
    }

    .stats-chart-legend {
        gap: 7px;
        font-size: calc(8px + var(--interface-font-delta));
    }

    .stats-chart-legend span {
        gap: 3px;
    }

    .stats-chart-legend i {
        width: 7px;
        height: 7px;
    }

    .stats-chart-scroll {
        width: 100%;
        overflow: hidden;
        padding: 0;
    }

    .stats-chart {
        width: 100%;
        min-width: 0;
        height: 185px;
    }

    .stats-chart-axis-label {
        font-size: calc(9px + var(--interface-font-delta));
    }

    .stats-table-desktop {
        display: none;
    }

    .stats-mobile-data-list {
        display: grid;
        gap: 5px;
    }

    .stats-mobile-data-card {
        min-width: 0;
        padding: 7px 8px;
        background: #fff;
        border: 1px solid #dedede;
        border-radius: 8px;
    }

    .stats-mobile-data-heading {
        display: flex;
        min-width: 0;
        align-items: center;
        justify-content: space-between;
        gap: 8px;
        padding-bottom: 5px;
        border-bottom: 1px solid #ededed;
    }

    .stats-mobile-data-heading > strong {
        font-size: calc(12px + var(--interface-font-delta));
    }

    .stats-mobile-data-heading > span {
        color: #8f0010;
        font-size: calc(15px + var(--interface-font-delta));
        font-weight: 900;
        font-variant-numeric: tabular-nums;
    }

    .stats-mobile-data-metrics {
        display: grid;
        grid-template-columns: repeat(5, minmax(0, 1fr));
        gap: 3px;
        padding-top: 5px;
    }

    .stats-mobile-data-metrics > span {
        display: grid;
        min-width: 0;
        gap: 2px;
        text-align: center;
    }

    .stats-mobile-data-metrics small {
        overflow: hidden;
        color: #777;
        font-size: calc(6.5px + var(--interface-font-delta));
        font-weight: 800;
        line-height: 1;
        text-overflow: ellipsis;
        white-space: nowrap;
    }

    .stats-mobile-data-metrics strong {
        font-size: calc(10px + var(--interface-font-delta));
        font-variant-numeric: tabular-nums;
    }

    .stats-mobile-day-card .stats-mobile-data-heading > span:first-child {
        display: flex;
        min-width: 0;
        align-items: baseline;
        gap: 6px;
        color: inherit;
        font-weight: inherit;
    }

    .stats-mobile-day-card .stats-mobile-data-heading > span:first-child strong {
        font-size: calc(11px + var(--interface-font-delta));
    }

    .stats-mobile-day-card .stats-mobile-data-heading > span:first-child small {
        color: #777;
        font-size: calc(8.5px + var(--interface-font-delta));
        font-weight: 700;
    }

    .stats-mobile-day-hours {
        flex: 0 0 auto;
        color: #8f0010 !important;
        font-size: calc(15px + var(--interface-font-delta)) !important;
    }

    .stats-mobile-day-meta {
        display: flex;
        min-width: 0;
        align-items: center;
        justify-content: space-between;
        gap: 7px;
        padding-top: 5px;
        color: #666;
        font-size: calc(8px + var(--interface-font-delta));
    }

    .stats-mobile-day-meta > span strong {
        margin-left: 3px;
        color: #b94700;
        font-size: calc(9px + var(--interface-font-delta));
    }

    .stats-mobile-statuses {
        display: flex;
        min-width: 0;
        flex-wrap: wrap;
        justify-content: flex-end;
        gap: 3px;
    }

    .stats-mobile-statuses span {
        padding: 2px 5px;
        border: 1px solid #ddd;
        border-radius: 999px;
        font-size: calc(6.5px + var(--interface-font-delta));
        font-weight: 900;
        line-height: 1;
        text-transform: uppercase;
    }

    .stats-mobile-statuses .leave {
        color: #355f22;
        background: #e1f0c2;
        border-color: #b9d68f;
    }

    .stats-mobile-statuses .free {
        color: #075384;
        background: #dceeff;
        border-color: #a9cee9;
    }

    .stats-mobile-statuses .delegation {
        color: #4c2d91;
        background: #f1eaff;
        border-color: #d3c2ef;
    }

    .stats-mobile-empty {
        margin: 0;
        padding: 10px;
        color: #777;
        background: #fff;
        border: 1px solid #dedede;
        border-radius: 8px;
        font-size: calc(10px + var(--interface-font-delta));
        text-align: center;
    }

    html[data-theme="dark"] .mobile-month-calendar,
    html[data-theme="dark"] .stats-expandable-section {
        color: var(--dark-text);
        background: var(--dark-surface-raised);
        border-color: var(--dark-border);
    }

    html[data-theme="dark"] .mobile-calendar-weekdays span,
    html[data-theme="dark"] .mobile-calendar-hint,
    html[data-theme="dark"] .mobile-week-day-heading > span,
    html[data-theme="dark"] .stats-expandable-copy small,
    html[data-theme="dark"] .stats-mobile-data-metrics small,
    html[data-theme="dark"] .stats-mobile-day-card .stats-mobile-data-heading > span:first-child small,
    html[data-theme="dark"] .stats-mobile-day-meta,
    html[data-theme="dark"] .stats-mobile-empty {
        color: var(--dark-muted);
    }

    html[data-theme="dark"] .mobile-month-day,
    html[data-theme="dark"] .mobile-week-day,
    html[data-theme="dark"] .stats-mobile-data-card,
    html[data-theme="dark"] .stats-mobile-empty,
    html[data-theme="dark"] .stats-expandable-icon {
        color: var(--dark-text);
        background: var(--dark-surface);
        border-color: var(--dark-border-soft);
    }

    html[data-theme="dark"] .mobile-month-day.weekend,
    html[data-theme="dark"] .mobile-week-day.weekend,
    html[data-theme="dark"] .stats-mobile-day-card.weekend {
        background: #332c16;
        border-color: #665824;
    }

    html[data-theme="dark"] .mobile-month-day.swieto,
    html[data-theme="dark"] .mobile-week-day.swieto {
        background: #3b181d;
        border-color: #71323c;
    }

    html[data-theme="dark"] .mobile-month-day.urlop,
    html[data-theme="dark"] .mobile-week-day.urlop,
    html[data-theme="dark"] .stats-mobile-day-card.urlop {
        background: #183522;
        border-color: #39734a;
    }

    html[data-theme="dark"] .mobile-month-day.wolne,
    html[data-theme="dark"] .mobile-week-day.wolne,
    html[data-theme="dark"] .stats-mobile-day-card.wolne {
        background: #172e43;
        border-color: #376384;
    }

    html[data-theme="dark"] .mobile-month-day.delegacja,
    html[data-theme="dark"] .mobile-week-day.delegacja,
    html[data-theme="dark"] .stats-mobile-day-card.delegacja {
        background: #2b2143;
        border-color: #5d4b87;
    }

    html[data-theme="dark"] .mobile-month-day.is-today,
    html[data-theme="dark"] .mobile-week-day.is-today {
        border-color: #ff596b;
        box-shadow: inset 0 0 0 1.5px #ff596b;
    }

    html[data-theme="dark"] .mobile-month-day-top i,
    html[data-theme="dark"] .mobile-week-day-heading i,
    html[data-theme="dark"] .mobile-week-day-content > strong,
    html[data-theme="dark"] .stats-mobile-data-heading > span,
    html[data-theme="dark"] .stats-mobile-day-hours,
    html[data-theme="dark"] .stats-expandable-icon {
        color: var(--dark-accent) !important;
    }

    html[data-theme="dark"] .stats-expandable-body,
    html[data-theme="dark"] .stats-mobile-data-heading {
        border-color: var(--dark-table-border);
    }

    html[data-theme="dark"] .stats-mobile-statuses .plain {
        color: #d2d2d7;
        background: #29292d;
        border-color: #48484e;
    }

    html[data-theme="dark"] .stats-mobile-statuses .leave {
        color: #a7e3b5;
        background: #183522;
        border-color: #39734a;
    }

    html[data-theme="dark"] .stats-mobile-statuses .free {
        color: #acd9ff;
        background: #172e43;
        border-color: #376384;
    }

    html[data-theme="dark"] .stats-mobile-statuses .delegation {
        color: #d8c8ff;
        background: #2b2143;
        border-color: #5d4b87;
    }
}

@media (max-width: 360px) {
    .period-summary-grid .summary-tile span,
    .stats-primary-grid .stats-color-card span {
        font-size: calc(7px + var(--interface-font-delta));
    }

    .period-summary-grid .summary-tile strong,
    .stats-primary-grid .stats-color-card strong {
        font-size: calc(15px + var(--interface-font-delta));
    }

    .mobile-month-day,
    .mobile-month-day-placeholder {
        min-height: 47px;
    }
}

/* V2.55 — większa typografia kalendarza i statystyk oraz klienci w miesiącu */
@media (max-width: 700px) {
    .calendar-overview-card .month-picker-main-text,
    .stats-period-main-button .month-picker-main-text {
        font-size: calc(15px + var(--interface-font-delta));
    }

    .calendar-overview-card .week-range {
        font-size: calc(11.5px + var(--interface-font-delta));
    }

    .calendar-view-text strong {
        font-size: calc(11.5px + var(--interface-font-delta));
    }

    .period-summary-grid .summary-tile {
        min-height: 49px;
        padding: 6px 3px;
    }

    .period-summary-grid .summary-tile span {
        font-size: calc(8.5px + var(--interface-font-delta));
        line-height: 1.08;
    }

    .period-summary-grid .summary-tile strong {
        font-size: calc(17px + var(--interface-font-delta));
    }

    .mobile-calendar-weekdays span {
        font-size: calc(9.5px + var(--interface-font-delta));
    }

    .mobile-month-day,
    .mobile-month-day-placeholder {
        min-height: 68px;
    }

    .mobile-month-day {
        gap: 2px;
        padding: 5px 4px;
    }

    .mobile-month-day-top strong {
        font-size: calc(13.5px + var(--interface-font-delta));
    }

    .mobile-month-day-top i {
        font-size: calc(7.5px + var(--interface-font-delta));
    }

    .mobile-month-day-client {
        display: -webkit-box;
        min-width: 0;
        overflow: hidden;
        color: #555;
        font-size: calc(7.8px + var(--interface-font-delta));
        font-weight: 750;
        line-height: 1.08;
        overflow-wrap: anywhere;
        text-align: center;
        -webkit-box-orient: vertical;
        -webkit-line-clamp: 2;
    }

    .mobile-month-day-value {
        font-size: calc(9.5px + var(--interface-font-delta));
    }

    .mobile-month-day > small {
        font-size: calc(7.5px + var(--interface-font-delta));
    }

    .mobile-calendar-hint {
        font-size: calc(9.5px + var(--interface-font-delta));
    }

    .mobile-week-calendar {
        gap: 6px;
    }

    .mobile-week-day {
        min-height: 70px;
        gap: 6px;
        padding: 8px;
    }

    .mobile-week-day-heading strong {
        font-size: calc(13px + var(--interface-font-delta));
    }

    .mobile-week-day-heading > span {
        font-size: calc(10px + var(--interface-font-delta));
    }

    .mobile-week-day-heading i {
        font-size: calc(8px + var(--interface-font-delta));
    }

    .mobile-week-day-content > span {
        font-size: calc(10.5px + var(--interface-font-delta));
    }

    .mobile-week-day-content > strong {
        font-size: calc(16px + var(--interface-font-delta));
    }

    .mobile-week-day > small {
        font-size: calc(9px + var(--interface-font-delta));
    }

    .stats-tabs a {
        font-size: calc(12px + var(--interface-font-delta));
    }

    .stats-primary-grid .stats-color-card {
        min-height: 54px;
        padding: 7px;
    }

    .stats-primary-grid .stats-color-card span {
        margin-bottom: 4px;
        font-size: calc(9px + var(--interface-font-delta));
        line-height: 1.1;
    }

    .stats-primary-grid .stats-color-card strong {
        font-size: calc(19px + var(--interface-font-delta));
    }

    .stats-expandable-section > summary {
        min-height: 43px;
        padding: 7px 9px;
    }

    .stats-expandable-copy strong {
        font-size: calc(12.5px + var(--interface-font-delta));
    }

    .stats-expandable-copy small {
        font-size: calc(9.5px + var(--interface-font-delta));
    }

    .ranking-card-grid-compact .ranking-card > span {
        font-size: calc(8.5px + var(--interface-font-delta));
    }

    .ranking-card-grid-compact .ranking-card strong {
        font-size: calc(17px + var(--interface-font-delta));
    }

    .ranking-card-grid-compact .ranking-card small,
    .stats-chart-legend {
        font-size: calc(9.5px + var(--interface-font-delta));
    }

    .stats-chart-heading h3 {
        font-size: calc(12px + var(--interface-font-delta));
    }

    .stats-mobile-data-heading > strong {
        font-size: calc(13px + var(--interface-font-delta));
    }

    .stats-mobile-data-heading > span,
    .stats-mobile-day-hours {
        font-size: calc(16px + var(--interface-font-delta)) !important;
    }

    .stats-mobile-data-metrics small {
        font-size: calc(7.5px + var(--interface-font-delta));
    }

    .stats-mobile-data-metrics strong {
        font-size: calc(11px + var(--interface-font-delta));
    }

    .stats-mobile-day-card .stats-mobile-data-heading > span:first-child strong {
        font-size: calc(12px + var(--interface-font-delta));
    }

    .stats-mobile-day-card .stats-mobile-data-heading > span:first-child small {
        font-size: calc(9.5px + var(--interface-font-delta));
    }

    .stats-mobile-day-meta {
        font-size: calc(9px + var(--interface-font-delta));
    }

    .stats-mobile-day-meta > span strong {
        font-size: calc(10px + var(--interface-font-delta));
    }

    .stats-mobile-statuses span {
        font-size: calc(7.5px + var(--interface-font-delta));
    }

    html[data-theme="dark"] .mobile-month-day-client {
        color: var(--dark-muted);
    }
}

@media (max-width: 360px) {
    .period-summary-grid .summary-tile span {
        font-size: calc(8px + var(--interface-font-delta));
    }

    .stats-primary-grid .stats-color-card span {
        font-size: calc(8.5px + var(--interface-font-delta));
    }

    .period-summary-grid .summary-tile strong {
        font-size: calc(16px + var(--interface-font-delta));
    }

    .stats-primary-grid .stats-color-card strong {
        font-size: calc(18px + var(--interface-font-delta));
    }

    .mobile-month-day,
    .mobile-month-day-placeholder {
        min-height: 66px;
    }

    .mobile-month-day-client {
        font-size: calc(7.4px + var(--interface-font-delta));
    }
}


/* V2.56 — zwarty i czytelny mobilny formularz dnia */
.mobile-helper-copy {
    display: none;
}

@media (max-width: 700px) {
    .day-editor-page .day-editor-topbar {
        margin-bottom: 4px;
    }

    .day-editor-page .back-to-calendar-button {
        min-height: 34px;
        gap: 4px;
        padding: 5px 9px;
        border-radius: 7px;
        font-size: calc(12px + var(--interface-font-delta));
    }

    .day-editor-page .back-to-calendar-button span {
        font-size: calc(20px + var(--interface-font-delta));
    }

    .day-editor-page .day-editor-card {
        padding: 8px;
        border-radius: 9px;
    }

    .day-editor-page .day-editor-header {
        margin-bottom: 7px;
        padding-bottom: 7px;
    }

    .day-editor-page .day-editor-eyebrow {
        display: none;
    }

    .day-editor-page .day-editor-header h2 {
        font-size: calc(18px + var(--interface-font-delta));
        line-height: 1.12;
    }

    .day-editor-page .day-editor-holiday {
        margin-top: 3px;
        font-size: calc(11px + var(--interface-font-delta));
    }

    .day-editor-page :where(.single-day-form, .day-editor-form) {
        gap: 7px;
    }

    .day-editor-page .day-editor-section {
        padding: 8px;
        border-radius: 9px;
    }

    .day-editor-page :where(.section-heading, .section-heading-with-action) {
        gap: 3px;
        margin-bottom: 7px;
    }

    .day-editor-page .section-heading > div {
        gap: 6px;
    }

    .day-editor-page .section-number {
        width: 20px;
        height: 20px;
        font-size: calc(10px + var(--interface-font-delta));
    }

    .day-editor-page .section-heading h3 {
        font-size: calc(15px + var(--interface-font-delta));
        line-height: 1.15;
    }

    .day-editor-page .section-heading p {
        padding-left: 26px;
        font-size: calc(10.5px + var(--interface-font-delta));
        line-height: 1.2;
    }

    .day-editor-page :where(.day-status-section, .day-details-section) .day-section-long-help {
        display: none;
    }

    .day-editor-page .desktop-helper-copy {
        display: none;
    }

    .day-editor-page .mobile-helper-copy {
        display: inline;
    }

    .day-editor-page .day-status-grid {
        gap: 5px;
    }

    .day-editor-page .day-status-grid .status-option-large {
        min-height: 34px;
        gap: 5px;
        margin: 0;
        padding: 5px 7px;
        border-radius: 7px;
        font-size: calc(12px + var(--interface-font-delta));
        line-height: 1.1;
    }

    .day-editor-page .day-status-grid input {
        width: 14px;
        height: 14px;
        margin: 0;
    }

    .day-editor-page .single-time-grid {
        gap: 5px;
    }

    .day-editor-page .single-time-group {
        gap: 4px;
        padding: 6px 7px 7px;
        border-radius: 8px;
    }

    .day-editor-page .single-time-group legend {
        padding: 0 4px;
        font-size: calc(11.5px + var(--interface-font-delta));
        line-height: 1.1;
    }

    .day-editor-page .single-time-pair {
        gap: 5px;
    }

    .day-editor-page .single-time-group label:not(.compact-check) {
        gap: 2px;
        font-size: calc(10.5px + var(--interface-font-delta));
        line-height: 1.15;
    }

    .day-editor-page .single-time-pair input[type="time"] {
        height: 36px;
        min-height: 36px;
        padding: 3px 2px;
        font-size: calc(14px + var(--interface-font-delta));
    }

    .day-editor-page .time-field-with-unlock {
        display: grid;
        grid-template-columns: minmax(0, 1fr) 32px;
        align-items: end;
        gap: 3px;
    }

    .day-editor-page .time-field-with-unlock > label {
        grid-column: 1;
        grid-row: 1;
    }

    .day-editor-page .time-field-with-unlock .time-unlock-button {
        grid-column: 2;
        grid-row: 1;
        align-self: end;
        width: 32px;
        min-width: 32px;
        min-height: 36px;
        padding: 0;
        border-radius: 7px;
        font-size: 0;
        line-height: 1;
    }

    .day-editor-page .time-field-with-unlock .time-unlock-button::before {
        content: "✎";
        font-size: calc(15px + var(--interface-font-delta));
    }

    .day-editor-page .time-field-with-unlock .time-unlock-button[data-manual="1"]::before {
        content: "↺";
        font-size: calc(17px + var(--interface-font-delta));
    }

    .day-editor-page .next-day-option {
        min-height: 24px;
        gap: 5px;
        margin: 0;
        font-size: calc(11.5px + var(--interface-font-delta));
        line-height: 1.15;
    }

    .day-editor-page .next-day-option input {
        width: 14px;
        height: 14px;
        margin: 0;
    }

    .day-editor-page .remote-under-hours {
        display: grid;
        grid-template-columns: max-content minmax(0, 1fr);
        align-items: center;
        gap: 5px 7px;
        max-width: none;
        margin-top: 6px;
        padding: 6px 7px;
        border-radius: 8px;
    }

    .day-editor-page .remote-under-hours > .field-label {
        display: none;
    }

    .day-editor-page .remote-under-hours > .status-option {
        min-height: 34px;
        gap: 5px;
        margin: 0;
        padding: 5px 7px;
        border-radius: 7px;
        font-size: calc(11.5px + var(--interface-font-delta));
        line-height: 1.1;
        white-space: nowrap;
    }

    .day-editor-page .remote-under-hours > .status-option input {
        width: 14px;
        height: 14px;
        margin: 0;
    }

    .day-editor-page .remote-time-editor {
        justify-content: flex-end;
        flex-wrap: nowrap;
        gap: 5px;
        margin: 0;
    }

    .day-editor-page .remote-time-editor .remote-duration-field {
        gap: 3px;
        font-size: calc(11px + var(--interface-font-delta));
    }

    .day-editor-page .remote-time-editor .remote-duration-field input {
        width: 46px;
        height: 34px;
        min-height: 34px;
        padding: 3px;
        font-size: calc(14px + var(--interface-font-delta));
    }

    .day-editor-page .day-basic-grid {
        gap: 7px;
    }

    .day-editor-page :where(.editor-field > label:first-child, .field-label) {
        margin-bottom: 3px;
        font-size: calc(11.5px + var(--interface-font-delta));
        line-height: 1.15;
    }

    .day-editor-page :where(
        .editor-field input[type="text"],
        .editor-field input:not([type]),
        .editor-field textarea,
        .multi-client-input
    ) {
        min-height: 36px;
        padding: 6px 7px;
        font-size: calc(14px + var(--interface-font-delta));
    }

    .day-editor-page .editor-field textarea {
        height: 58px;
        min-height: 58px;
        line-height: 1.25;
        resize: vertical;
    }

    .day-editor-page .client-memory-help {
        display: none;
    }

    .day-editor-page .day-editor-summary.day-editor-bottom-summary {
        gap: 5px;
    }

    .day-editor-page .day-editor-bottom-summary > div {
        padding: 6px 5px;
        border-radius: 7px;
    }

    .day-editor-page .day-editor-summary span {
        margin-bottom: 2px;
        font-size: calc(8.5px + var(--interface-font-delta));
    }

    .day-editor-page .day-editor-bottom-summary strong {
        font-size: calc(17px + var(--interface-font-delta));
    }

    .day-editor-page :where(.day-editor-actions, .day-editor-actions-complete) {
        display: grid;
        grid-template-columns: repeat(2, minmax(0, 1fr));
        align-items: stretch;
        gap: 5px;
    }

    .day-editor-page :where(
        .save-day-button,
        .secondary-action-button,
        .day-editor-actions-complete .delete-day-button
    ) {
        width: 100%;
        min-width: 0;
        min-height: 38px;
        margin: 0;
        padding: 7px 6px;
        border-radius: 7px;
        box-sizing: border-box;
        font-size: calc(11.5px + var(--interface-font-delta));
        line-height: 1.15;
        text-align: center;
    }

    .day-editor-page .day-editor-actions-complete .delete-day-button {
        grid-column: 1 / -1;
    }
}

@media (max-width: 360px) {
    .day-editor-page .day-editor-card {
        padding: 6px;
    }

    .day-editor-page .day-editor-section {
        padding: 7px;
    }

    .day-editor-page .single-time-group {
        padding-right: 6px;
        padding-left: 6px;
    }

    .day-editor-page .single-time-pair input[type="time"] {
        font-size: calc(13px + var(--interface-font-delta));
    }

    .day-editor-page .time-field-with-unlock {
        grid-template-columns: minmax(0, 1fr) 30px;
    }

    .day-editor-page .time-field-with-unlock .time-unlock-button {
        width: 30px;
        min-width: 30px;
    }

    .day-editor-page .remote-time-editor .remote-duration-field input {
        width: 42px;
    }

    .day-editor-page :where(
        .save-day-button,
        .secondary-action-button,
        .day-editor-actions-complete .delete-day-button
    ) {
        font-size: calc(11px + var(--interface-font-delta));
    }
}

/* V2.58 — końcowe priorytety po stylach mobilnego formularza V2.56 */
@media (max-width: 700px) {
    .day-editor-page .day-editor-summary.day-editor-bottom-summary {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }

    .stats-mobile-data-metrics {
        grid-template-columns: repeat(3, minmax(0, 1fr));
        row-gap: 6px;
    }
}

@media (max-width: 360px) {
    .day-editor-page .day-editor-summary span {
        font-size: calc(7.5px + var(--interface-font-delta));
    }

    .day-editor-page .day-editor-bottom-summary strong,
    .stats-balance-grid strong {
        font-size: calc(14px + var(--interface-font-delta));
    }
}

/* V2.60 — pełny tryb offline oraz nadrzędne weekendy i święta */
.offline-status {
    position: relative;
    z-index: 950;
    display: flex;
    min-height: 46px;
    box-sizing: border-box;
    align-items: center;
    justify-content: center;
    gap: 10px;
    padding: 8px max(14px, env(safe-area-inset-right)) 8px max(14px, env(safe-area-inset-left));
    color: #493600;
    background: #fff3bd;
    border-bottom: 1px solid #ddc867;
    box-shadow: 0 3px 10px rgba(87, 63, 0, .12);
}

.offline-status.syncing {
    color: #07516b;
    background: #dff5ff;
    border-bottom-color: #9ecfe1;
}

.offline-status.waiting {
    color: #174f2a;
    background: #e5f7e8;
    border-bottom-color: #a9d8b2;
}

.offline-status.warning {
    color: #7a1c16;
    background: #ffe4df;
    border-bottom-color: #e8aba0;
}

.offline-status-icon {
    display: inline-flex;
    width: 28px;
    height: 28px;
    flex: 0 0 28px;
    align-items: center;
    justify-content: center;
    border: 1px solid currentColor;
    border-radius: 50%;
    font-size: calc(18px + var(--interface-font-delta));
    font-weight: 900;
    line-height: 1;
}

.offline-status.syncing .offline-status-icon {
    animation: offline-sync-spin 1.1s linear infinite;
}

@keyframes offline-sync-spin {
    to { transform: rotate(360deg); }
}

.offline-status-copy {
    display: grid;
    min-width: 0;
    gap: 1px;
}

.offline-status-copy strong {
    font-size: calc(13px + var(--interface-font-delta));
    line-height: 1.15;
}

.offline-status-copy small {
    font-size: calc(11px + var(--interface-font-delta));
    line-height: 1.25;
}

.offline-sync-button {
    min-height: 30px;
    margin-left: 6px;
    padding: 5px 10px;
    color: inherit;
    background: rgba(255, 255, 255, .58);
    border: 1px solid currentColor;
    border-radius: 8px;
    font-size: calc(11px + var(--interface-font-delta));
}

.summary-day-row.swieto > td,
.summary-day-row.swieto:hover > td,
.summary-day-row.swieto:focus-visible > td {
    background: #ffe1e1 !important;
}

.summary-day-row.weekend > td,
.summary-day-row.weekend:hover > td,
.summary-day-row.weekend:focus-visible > td {
    background: #fff3bd !important;
}

.calendar-auto-free-label,
.calendar-worked-special-label {
    display: inline-flex;
    align-items: center;
    padding: 2px 6px;
    border-radius: 999px;
    font-size: calc(9px + var(--interface-font-delta));
    font-weight: 900;
    line-height: 1.1;
    white-space: nowrap;
}

.calendar-auto-free-label {
    color: #5b4700;
    background: rgba(255, 255, 255, .62);
    border: 1px solid rgba(108, 82, 0, .25);
}

.calendar-worked-special-label {
    color: #fff;
    background: #126a92;
    border: 1px solid #075375;
    letter-spacing: .25px;
    text-transform: uppercase;
}

.summary-day-row.worked-special-day > td:first-child {
    box-shadow: inset 4px 0 0 #126a92;
}

.summary-day-row.worked-special-day .summary-hours-cell strong,
.summary-weekday-cell.worked-special-day {
    color: #075c84;
    font-weight: 900;
}

.automatic-free-notice {
    display: flex;
    align-items: center;
    gap: 10px;
    margin: -8px 0 15px;
    padding: 10px 12px;
    color: #594500;
    background: #fff3bd;
    border: 1px solid #dfca6f;
    border-radius: 11px;
}

.automatic-free-notice.holiday {
    color: #781923;
    background: #ffe1e1;
    border-color: #e6aab0;
}

.automatic-free-notice > span:first-child {
    display: inline-flex;
    width: 28px;
    height: 28px;
    flex: 0 0 28px;
    align-items: center;
    justify-content: center;
    color: currentColor;
    background: rgba(255, 255, 255, .6);
    border-radius: 50%;
    font-size: calc(14px + var(--interface-font-delta));
}

.automatic-free-notice > span:last-child {
    display: grid;
    gap: 2px;
}

.automatic-free-notice strong {
    font-size: calc(12px + var(--interface-font-delta));
}

.automatic-free-notice small {
    font-size: calc(10.5px + var(--interface-font-delta));
    line-height: 1.3;
}

.day-status-grid .automatic-free-option {
    color: #594500;
    background: #fff8d8;
    border-color: #dbc96e;
}

.day-status-grid .automatic-free-option.holiday {
    color: #781923;
    background: #fff0f0;
    border-color: #e5b0b5;
}

.day-status-grid .automatic-free-option input {
    accent-color: #b88c00;
}

.day-status-grid .automatic-free-option.holiday input {
    accent-color: #c90016;
}

.day-status-grid .automatic-free-option:has(input:checked) {
    box-shadow: inset 0 0 0 2px currentColor;
}

html[data-theme="dark"] .offline-status.offline {
    color: #ffe995;
    background: #332c16;
    border-bottom-color: #665824;
}

html[data-theme="dark"] .offline-status.syncing {
    color: #9be3ff;
    background: #15303c;
    border-bottom-color: #31667b;
}

html[data-theme="dark"] .offline-status.waiting {
    color: #a6e8b2;
    background: #173422;
    border-bottom-color: #39734a;
}

html[data-theme="dark"] .offline-status.warning {
    color: #ffb3aa;
    background: #3d1a18;
    border-bottom-color: #7b3a34;
}

html[data-theme="dark"] .summary-day-row.swieto > td,
html[data-theme="dark"] .summary-day-row.swieto:hover > td,
html[data-theme="dark"] .summary-day-row.swieto:focus-visible > td {
    color: var(--dark-text);
    background: #3b181d !important;
    border-color: #71323c !important;
}

html[data-theme="dark"] .summary-day-row.weekend > td,
html[data-theme="dark"] .summary-day-row.weekend:hover > td,
html[data-theme="dark"] .summary-day-row.weekend:focus-visible > td {
    color: var(--dark-text);
    background: #332c16 !important;
    border-color: #665824 !important;
}

html[data-theme="dark"] .calendar-auto-free-label {
    color: #ffe995;
    background: rgba(0, 0, 0, .22);
    border-color: rgba(255, 233, 149, .28);
}

html[data-theme="dark"] .calendar-worked-special-label {
    color: #dff7ff;
    background: #0f5879;
    border-color: #45a7d0;
}

html[data-theme="dark"] .summary-day-row.worked-special-day .summary-hours-cell strong,
html[data-theme="dark"] .summary-weekday-cell.worked-special-day {
    color: #8edcff;
}

html[data-theme="dark"] .automatic-free-notice,
html[data-theme="dark"] .day-status-grid .automatic-free-option {
    color: #ffe995;
    background: #332c16;
    border-color: #665824;
}

html[data-theme="dark"] .automatic-free-notice.holiday,
html[data-theme="dark"] .day-status-grid .automatic-free-option.holiday {
    color: #ffb8c0;
    background: #3b181d;
    border-color: #71323c;
}

@media (max-width: 760px) {
    .offline-status {
        position: sticky;
        top: 70px;
        justify-content: flex-start;
        gap: 7px;
        min-height: 42px;
        padding: 6px 8px;
    }

    .offline-status-icon {
        width: 24px;
        height: 24px;
        flex-basis: 24px;
        font-size: calc(15px + var(--interface-font-delta));
    }

    .offline-status-copy {
        flex: 1;
    }

    .offline-status-copy strong {
        font-size: calc(11px + var(--interface-font-delta));
    }

    .offline-status-copy small {
        display: -webkit-box;
        overflow: hidden;
        font-size: calc(9px + var(--interface-font-delta));
        line-height: 1.2;
        -webkit-box-orient: vertical;
        -webkit-line-clamp: 2;
    }

    .offline-sync-button {
        min-height: 27px;
        margin-left: auto;
        padding: 4px 7px;
        font-size: calc(9px + var(--interface-font-delta));
    }

    .mobile-month-day.weekend,
    .mobile-week-day.weekend {
        background: #fff3bd !important;
        border-color: #d7bd4f !important;
    }

    .mobile-month-day.swieto,
    .mobile-week-day.swieto {
        background: #ffe1e1 !important;
        border-color: #dc929b !important;
    }

    .mobile-month-day.worked-special-day,
    .mobile-week-day.worked-special-day {
        box-shadow: inset 0 -3px 0 #126a92;
    }

    .mobile-month-day.worked-special-day.is-today,
    .mobile-week-day.worked-special-day.is-today {
        box-shadow: inset 0 -3px 0 #126a92, inset 0 0 0 1.5px #c90016;
    }

    .mobile-month-day.worked-special-day .mobile-month-day-value,
    .mobile-week-day.worked-special-day .mobile-week-day-content > strong {
        color: #075c84;
        font-weight: 950;
    }

    .mobile-special-state-mark {
        display: inline-flex;
        width: 12px;
        height: 12px;
        flex: 0 0 12px;
        align-items: center;
        justify-content: center;
        margin-left: auto;
        color: #5a4300;
        background: rgba(255, 255, 255, .72);
        border: 1px solid rgba(90, 67, 0, .28);
        border-radius: 50%;
        font-size: calc(7px + var(--interface-font-delta));
        font-weight: 950;
        line-height: 1;
    }

    .mobile-special-state-mark.worked {
        color: #fff;
        background: #126a92;
        border-color: #075375;
    }

    .mobile-month-day-top .mobile-special-state-mark + i {
        margin-left: 0;
    }

    .mobile-week-special-badges {
        display: flex;
        min-width: 0;
        align-items: center;
        gap: 4px;
        margin-top: -2px;
        overflow: hidden;
    }

    .mobile-week-special-badges b,
    .mobile-week-special-badges em {
        overflow: hidden;
        padding: 2px 5px;
        border-radius: 999px;
        font-size: calc(7.5px + var(--interface-font-delta));
        font-style: normal;
        font-weight: 900;
        line-height: 1;
        text-overflow: ellipsis;
        white-space: nowrap;
    }

    .mobile-week-special-badges b {
        color: #5a4300;
        background: rgba(255, 255, 255, .62);
        border: 1px solid rgba(90, 67, 0, .2);
    }

    .mobile-week-special-badges em {
        color: #5b3d72;
        background: rgba(255, 255, 255, .72);
        border: 1px solid rgba(91, 61, 114, .25);
    }

    .mobile-week-special-badges em.worked {
        color: #fff;
        background: #126a92;
        border-color: #075375;
        text-transform: uppercase;
    }

    .automatic-free-notice {
        gap: 7px;
        margin: -4px 0 8px;
        padding: 7px 8px;
    }

    .automatic-free-notice > span:first-child {
        width: 24px;
        height: 24px;
        flex-basis: 24px;
        font-size: calc(12px + var(--interface-font-delta));
    }

    .automatic-free-notice strong {
        font-size: calc(10px + var(--interface-font-delta));
    }

    .automatic-free-notice small {
        font-size: calc(8.5px + var(--interface-font-delta));
        line-height: 1.2;
    }

    .day-editor-page .day-status-grid:has(.automatic-free-option) {
        grid-template-columns: repeat(5, minmax(0, 1fr));
    }

    .day-editor-page .day-status-grid .automatic-free-option {
        font-size: calc(8px + var(--interface-font-delta));
        line-height: 1.05;
    }

    html[data-theme="dark"] .mobile-month-day.weekend,
    html[data-theme="dark"] .mobile-week-day.weekend {
        color: var(--dark-text);
        background: #332c16 !important;
        border-color: #665824 !important;
    }

    html[data-theme="dark"] .mobile-month-day.swieto,
    html[data-theme="dark"] .mobile-week-day.swieto {
        color: var(--dark-text);
        background: #3b181d !important;
        border-color: #71323c !important;
    }

    html[data-theme="dark"] .mobile-month-day.worked-special-day .mobile-month-day-value,
    html[data-theme="dark"] .mobile-week-day.worked-special-day .mobile-week-day-content > strong {
        color: #8edcff;
    }

    html[data-theme="dark"] .mobile-week-special-badges b {
        color: #ffe995;
        background: rgba(0, 0, 0, .22);
        border-color: rgba(255, 233, 149, .25);
    }
}

@media (max-width: 380px) {
    .day-editor-page .day-status-grid:has(.automatic-free-option) {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }

    .day-editor-page .day-status-grid .automatic-free-option {
        grid-column: 1 / -1;
    }
}


/* V2.62 — poprawiony mobilny wybór „Rodzaj dnia” */
@media (max-width: 700px) {
    /*
       Weekend/święto zajmuje pełną szerokość, a cztery właściwe opcje
       układają się w czytelną siatkę 2 × 2. Selektor z :has() ma taką
       samą lub większą specyficzność niż wcześniejsze reguły 5-kolumnowe.
    */
    .day-editor-page .day-status-grid,
    .day-editor-page .day-status-grid:has(.automatic-free-option) {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 8px;
    }

    .day-editor-page .day-status-grid .status-option-large {
        min-width: 0;
        min-height: 44px;
        padding: 8px 10px;
        gap: 7px;
        font-size: calc(13px + var(--interface-font-delta));
        line-height: 1.15;
        white-space: nowrap;
        overflow-wrap: normal;
        word-break: normal;
        text-align: left;
    }

    .day-editor-page .day-status-grid .status-option-large input {
        flex: 0 0 auto;
    }

    .day-editor-page .day-status-grid .automatic-free-option,
    .day-editor-page .day-status-grid:has(.automatic-free-option) .automatic-free-option {
        grid-column: 1 / -1;
        min-height: 44px;
        font-size: calc(13px + var(--interface-font-delta));
        line-height: 1.15;
    }
}

@media (max-width: 360px) {
    .day-editor-page .day-status-grid .status-option-large,
    .day-editor-page .day-status-grid .automatic-free-option,
    .day-editor-page .day-status-grid:has(.automatic-free-option) .automatic-free-option {
        padding-right: 8px;
        padding-left: 8px;
        font-size: calc(12.5px + var(--interface-font-delta));
    }
}

/* V2.62 — aktualizacje, synchronizacja, szybkie akcje i formularz dnia */
body.app-update-locked,
body.calendar-quick-menu-open {
    overflow: hidden;
}

.app-update-overlay {
    position: fixed;
    inset: 0;
    z-index: 10000;
    display: grid;
    place-items: center;
    padding: 20px;
    background: rgba(15, 15, 18, .72);
    backdrop-filter: blur(8px);
}

.app-update-modal {
    width: min(100%, 440px);
    padding: 28px;
    text-align: center;
    background: #fff;
    border: 1px solid #dedee3;
    border-radius: 18px;
    box-shadow: 0 24px 70px rgba(0, 0, 0, .28);
}

.app-update-modal-icon {
    display: grid;
    place-items: center;
    width: 52px;
    height: 52px;
    margin: 0 auto 14px;
    color: #fff;
    font-size: calc(28px + var(--interface-font-delta));
    font-weight: 800;
    background: #c90016;
    border-radius: 50%;
    animation: app-update-spin 1.1s linear infinite;
}

.app-update-overlay[data-state="error"] .app-update-modal-icon {
    animation: none;
    background: #9a1e2d;
}

.app-update-modal h2 {
    margin: 0 0 10px;
    font-size: calc(22px + var(--interface-font-delta));
}

.app-update-modal p {
    margin: 0;
    color: #666;
    line-height: 1.5;
}

.app-update-modal .btn-canon {
    margin-top: 18px;
}

@keyframes app-update-spin {
    to { transform: rotate(360deg); }
}

.app-diagnostics-card,
.offline-settings-card {
    display: grid;
    gap: 18px;
}

.app-diagnostics-heading,
.offline-settings-heading,
.restore-version-heading {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 16px;
}

.app-diagnostics-heading h2,
.offline-settings-heading h2 {
    margin: 2px 0 6px;
}

.app-diagnostics-heading p,
.offline-settings-heading p {
    margin: 0;
    color: #6d6d74;
}

.app-diagnostics-grid,
.offline-settings-metrics {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 10px;
    margin: 0;
}

.app-diagnostics-grid > div,
.offline-settings-metrics > div {
    min-width: 0;
    padding: 13px 14px;
    background: #f6f6f8;
    border: 1px solid #e4e4e8;
    border-radius: 10px;
}

.app-diagnostics-grid dt,
.offline-settings-metrics span {
    display: block;
    margin-bottom: 5px;
    color: #777780;
    font-size: calc(12px + var(--interface-font-delta));
    font-weight: 700;
}

.app-diagnostics-grid dd,
.offline-settings-metrics strong {
    display: block;
    min-width: 0;
    margin: 0;
    overflow-wrap: anywhere;
    font-size: calc(15px + var(--interface-font-delta));
}

.offline-settings-badge {
    flex: 0 0 auto;
    padding: 6px 10px;
    font-size: calc(12px + var(--interface-font-delta));
    font-weight: 800;
    border-radius: 999px;
}

.offline-settings-badge.online {
    color: #176433;
    background: #dff6e7;
}

.offline-settings-badge.offline {
    color: #8a3d00;
    background: #fff0d8;
}

.offline-queue-details {
    border-top: 1px solid #e5e5e9;
    padding-top: 12px;
}

.offline-queue-details summary {
    cursor: pointer;
    font-weight: 800;
}

.offline-queue-details ol {
    display: grid;
    gap: 8px;
    margin: 12px 0 0;
    padding: 0;
    list-style: none;
}

.offline-queue-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 10px 12px;
    background: #f7f7f8;
    border: 1px solid #e4e4e8;
    border-radius: 9px;
}

.offline-queue-item span {
    min-width: 0;
}

.offline-queue-item strong,
.offline-queue-item small {
    display: block;
}

.offline-queue-item small {
    margin-top: 3px;
    color: #74747c;
}

.offline-queue-item b {
    flex: 0 0 auto;
    color: #835200;
    font-size: calc(11px + var(--interface-font-delta));
}

.offline-queue-item.blocked {
    background: #fff1f2;
    border-color: #e8b9bf;
}

.offline-queue-item.blocked b {
    color: #9d1829;
}

.restore-version-panel {
    display: grid;
    gap: 14px;
    padding: 16px;
    background: #f7f7f9;
    border: 1px solid #e2e2e7;
    border-radius: 12px;
}

.restore-version-panel > div > strong,
.restore-version-panel > div > small,
.restore-version-heading strong,
.restore-version-heading small {
    display: block;
}

.restore-version-heading small,
.restore-version-panel > div > small {
    margin-top: 4px;
    color: #717179;
}

.restore-version-heading > span {
    display: grid;
    place-items: center;
    min-width: 30px;
    height: 30px;
    padding: 0 8px;
    color: #fff;
    font-weight: 800;
    background: #c90016;
    border-radius: 999px;
}

.restore-version-controls {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 8px 12px;
    align-items: end;
}

.restore-version-controls label {
    grid-column: 1 / -1;
    font-weight: 700;
}

.restore-version-controls select {
    min-width: 0;
}

.diagnostic-update-error {
    color: #a01325 !important;
    font-weight: 700;
}

.calendar-quick-menu {
    position: fixed;
    inset: 0;
    z-index: 9000;
    display: flex;
    align-items: flex-end;
    justify-content: center;
}

.calendar-quick-menu-backdrop {
    position: absolute;
    inset: 0;
    background: rgba(15, 15, 18, .58);
    backdrop-filter: blur(3px);
}

.calendar-quick-sheet {
    position: relative;
    z-index: 1;
    width: min(100%, 520px);
    padding: 10px 16px calc(16px + env(safe-area-inset-bottom));
    background: #fff;
    border-radius: 18px 18px 0 0;
    box-shadow: 0 -16px 40px rgba(0, 0, 0, .2);
    animation: calendar-quick-in .2s ease-out;
}

@keyframes calendar-quick-in {
    from { transform: translateY(100%); }
    to { transform: translateY(0); }
}

.calendar-quick-handle {
    width: 42px;
    height: 4px;
    margin: 0 auto 12px;
    background: #c5c5ca;
    border-radius: 99px;
}

.calendar-quick-heading {
    margin-bottom: 12px;
}

.calendar-quick-heading > span {
    color: #7b7b83;
    font-size: calc(11px + var(--interface-font-delta));
    font-weight: 800;
    letter-spacing: .08em;
    text-transform: uppercase;
}

.calendar-quick-heading h2 {
    margin: 3px 0 0;
    font-size: calc(19px + var(--interface-font-delta));
}

.calendar-quick-action {
    display: flex;
    align-items: center;
    width: 100%;
    gap: 12px;
    margin-top: 8px;
    padding: 13px 14px;
    text-align: left;
    border: 1px solid #e1e1e5;
    border-radius: 11px;
    background: #f7f7f8;
}

.calendar-quick-action > span:first-child {
    display: grid;
    place-items: center;
    flex: 0 0 36px;
    width: 36px;
    height: 36px;
    font-size: calc(18px + var(--interface-font-delta));
    border-radius: 9px;
    background: #fff;
}

.calendar-quick-action strong,
.calendar-quick-action small {
    display: block;
}

.calendar-quick-action small {
    margin-top: 3px;
    color: #73737b;
    font-weight: 400;
}

.calendar-quick-action.leave {
    border-color: #c9d8ee;
    background: #eef5ff;
}

.calendar-quick-action.free {
    border-color: #d7d7dc;
    background: #f5f5f6;
}

.calendar-quick-cancel {
    width: 100%;
    margin-top: 12px;
}

.day-validation-summary {
    margin-top: 14px;
    padding: 13px 15px;
    color: #7e1020;
    background: #fff0f2;
    border: 1px solid #e5aab3;
    border-left: 4px solid #c90016;
    border-radius: 9px;
}

.day-validation-summary strong {
    display: block;
}

.day-validation-summary ul {
    margin: 7px 0 0;
    padding-left: 20px;
}

.day-validation-summary li + li {
    margin-top: 4px;
}

.day-editor-form .field-invalid:not([type="radio"]):not([type="checkbox"]),
.day-editor-form .field-invalid[type="radio"] + *,
.day-editor-form .field-invalid[type="checkbox"] + * {
    outline: 2px solid #c90016;
    outline-offset: 2px;
}

.day-editor-form input.field-invalid,
.day-editor-form textarea.field-invalid,
.day-editor-form select.field-invalid {
    border-color: #c90016 !important;
    background: #fff7f8;
}

.day-save-dock {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    margin-top: 16px;
    padding: 12px 14px;
    background: #f8f8f9;
    border: 1px solid #e2e2e6;
    border-radius: 12px;
}

.day-draft-status {
    margin: 0;
    color: #686870;
    font-size: calc(12px + var(--interface-font-delta));
    font-weight: 700;
    line-height: 1.35;
}

.day-draft-status[data-state="saving"],
.day-draft-status[data-state="submitting"] {
    color: #805900;
}

.day-draft-status[data-state="saved"],
.day-draft-status[data-state="offline"] {
    color: #7a5200;
}

.day-draft-status[data-state="synced"] {
    color: #176433;
}

.day-draft-status[data-state="error"] {
    color: #a01325;
}

.day-save-dock-actions {
    display: flex;
    flex: 0 0 auto;
    gap: 8px;
}

.day-save-dock-actions .secondary-action-button,
.day-save-dock-actions .btn-canon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 42px;
    text-decoration: none;
}

.day-danger-actions {
    display: flex;
    justify-content: flex-end;
    margin-top: 12px;
}

@media (max-width: 760px) {
    .app-diagnostics-heading,
    .offline-settings-heading {
        align-items: stretch;
        flex-direction: column;
    }

    .app-diagnostics-heading .btn-canon,
    .offline-settings-card > .secondary-action-button {
        width: 100%;
    }

    .app-diagnostics-grid,
    .offline-settings-metrics {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .offline-settings-metrics > div:last-child {
        grid-column: 1 / -1;
    }

    .restore-version-controls {
        grid-template-columns: 1fr;
    }

    .restore-version-controls label {
        grid-column: auto;
    }

    .restore-version-controls .btn-canon {
        width: 100%;
    }

    .day-editor-form {
        padding-bottom: 82px;
    }

    .day-save-dock {
        position: sticky;
        bottom: 0;
        z-index: 35;
        align-items: stretch;
        flex-direction: column;
        gap: 7px;
        margin: 14px -10px calc(-82px + env(safe-area-inset-bottom));
        padding: 9px 10px calc(9px + env(safe-area-inset-bottom));
        background: rgba(255, 255, 255, .96);
        border-right: 0;
        border-bottom: 0;
        border-left: 0;
        border-radius: 0;
        box-shadow: 0 -8px 24px rgba(0, 0, 0, .12);
        backdrop-filter: blur(12px);
    }

    .day-draft-status {
        min-height: 16px;
        text-align: center;
        font-size: calc(10.5px + var(--interface-font-delta));
    }

    .day-save-dock-actions {
        display: grid;
        grid-template-columns: minmax(0, .72fr) minmax(0, 1.28fr);
        width: 100%;
    }

    .day-save-dock-actions .secondary-action-button,
    .day-save-dock-actions .btn-canon {
        width: 100%;
        min-height: 42px;
        box-sizing: border-box;
    }

    .day-danger-actions {
        margin-top: 94px;
    }
}

@media (max-width: 390px) {
    .app-diagnostics-grid,
    .offline-settings-metrics {
        grid-template-columns: 1fr;
    }

    .offline-settings-metrics > div:last-child {
        grid-column: auto;
    }

    .app-update-modal {
        padding: 22px 18px;
    }
}

html[data-theme="dark"] .app-update-modal,
html[data-theme="dark"] .calendar-quick-sheet {
    color: var(--dark-text);
    background: var(--dark-surface-raised);
    border-color: var(--dark-border);
}

html[data-theme="dark"] .app-update-modal p,
html[data-theme="dark"] .app-diagnostics-heading p,
html[data-theme="dark"] .offline-settings-heading p,
html[data-theme="dark"] .restore-version-heading small,
html[data-theme="dark"] .restore-version-panel > div > small,
html[data-theme="dark"] .offline-queue-item small,
html[data-theme="dark"] .calendar-quick-action small,
html[data-theme="dark"] .day-draft-status {
    color: var(--dark-muted);
}

html[data-theme="dark"] .app-diagnostics-grid > div,
html[data-theme="dark"] .offline-settings-metrics > div,
html[data-theme="dark"] .offline-queue-item,
html[data-theme="dark"] .restore-version-panel,
html[data-theme="dark"] .calendar-quick-action,
html[data-theme="dark"] .day-save-dock {
    color: var(--dark-text);
    background: var(--dark-surface-soft);
    border-color: var(--dark-border);
}

html[data-theme="dark"] .calendar-quick-action > span:first-child {
    background: var(--dark-surface);
}

html[data-theme="dark"] .day-validation-summary {
    color: #ffb7c0;
    background: #351419;
    border-color: #74333d;
    border-left-color: var(--dark-accent);
}

html[data-theme="dark"] .day-editor-form input.field-invalid,
html[data-theme="dark"] .day-editor-form textarea.field-invalid,
html[data-theme="dark"] .day-editor-form select.field-invalid {
    background: #351419;
    border-color: var(--dark-accent) !important;
}

html[data-theme="dark"] .day-draft-status[data-state="saving"],
html[data-theme="dark"] .day-draft-status[data-state="submitting"],
html[data-theme="dark"] .day-draft-status[data-state="saved"],
html[data-theme="dark"] .day-draft-status[data-state="offline"] {
    color: #ffd47b;
}

html[data-theme="dark"] .day-draft-status[data-state="synced"] {
    color: #8ee3a8;
}

html[data-theme="dark"] .day-draft-status[data-state="error"] {
    color: #ff9ba8;
}

@media (max-width: 760px) {
    html[data-theme="dark"] .day-save-dock {
        background: rgba(23, 23, 25, .96);
    }
}


/* ==========================================
   V2.68 — MENU POMOC I OBSŁUGA ZGŁOSZEŃ
   ========================================== */
.help-page {
  display: grid;
  gap: 20px;
}
.help-page > .card { margin-bottom: 0; }
.help-intro-card,
.help-section-heading,
.help-request-card-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 18px;
}
.help-intro-card h2,
.help-section-heading h2 { margin: 3px 0 7px; }
.help-intro-card p,
.help-section-heading p { margin: 0; color: #68707b; }
.help-version-chip,
.help-count-chip {
  flex: 0 0 auto;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 34px;
  padding: 0 13px;
  border: 1px solid #e2e5e9;
  border-radius: 999px;
  background: #f6f7f8;
  color: #4e5661;
  font-weight: 800;
}
.help-count-chip.admin { color: #9b0011; background: #fff1f3; border-color: #f2c4ca; }
.help-request-form { display: grid; gap: 16px; margin-top: 18px; }
.help-type-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.help-type-choice {
  position: relative;
  display: grid;
  grid-template-columns: auto 1fr;
  grid-template-areas: "icon title" "icon copy";
  gap: 2px 12px;
  padding: 16px;
  border: 2px solid #e0e3e7;
  border-radius: 14px;
  background: #fafafa;
  cursor: pointer;
  transition: border-color .15s ease, background .15s ease, transform .15s ease;
}
.help-type-choice:hover { transform: translateY(-1px); border-color: #c9cdd3; }
.help-type-choice.is-selected { border-color: #c90016; background: #fff5f6; box-shadow: 0 0 0 3px rgba(201,0,22,.08); }
.help-type-choice input { position: absolute; opacity: 0; pointer-events: none; }
.help-type-icon { grid-area: icon; font-size: calc(28px + var(--interface-font-delta)); line-height: 1; }
.help-type-choice strong { grid-area: title; font-size: calc(17px + var(--interface-font-delta)); }
.help-type-choice small { grid-area: copy; color: #68707b; line-height: 1.35; }
.help-form-grid { display: grid; grid-template-columns: minmax(190px, .72fr) minmax(260px, 1.28fr); gap: 14px; }
.help-request-form > label,
.help-form-grid label,
.help-admin-form label { display: grid; gap: 7px; font-weight: 800; }
.help-request-form input,
.help-request-form select,
.help-request-form textarea,
.help-admin-form select,
.help-admin-form textarea {
  width: 100%;
  box-sizing: border-box;
  padding: 11px 12px;
  border: 1px solid #c8cdd3;
  border-radius: 9px;
  background: #fff;
  color: #222;
  font: inherit;
  font-weight: 400;
}
.help-diagnostics-consent {
  grid-template-columns: auto 1fr !important;
  align-items: flex-start;
  gap: 11px !important;
  padding: 13px 14px;
  border: 1px solid #d8dde2;
  border-radius: 11px;
  background: #f7f8f9;
}
.help-diagnostics-consent input { width: 20px; height: 20px; margin-top: 1px; }
.help-diagnostics-consent span { display: grid; gap: 3px; }
.help-diagnostics-consent small { color: #68707b; font-weight: 400; line-height: 1.4; }
.help-diagnostics-details,
.help-faq-item {
  border: 1px solid #dfe3e7;
  border-radius: 10px;
  background: #fafbfc;
}
.help-diagnostics-details > summary,
.help-faq-item > summary { padding: 12px 14px; cursor: pointer; font-weight: 800; }
.help-diagnostics-details[open] > summary,
.help-faq-item[open] > summary { border-bottom: 1px solid #e3e6e9; }
.help-diagnostics-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
  margin: 0;
  padding: 13px;
}
.help-diagnostics-grid > div { padding: 9px 10px; border-radius: 8px; background: #fff; border: 1px solid #e7eaed; }
.help-diagnostics-grid dt { color: #68707b; font-size: calc(12px + var(--interface-font-delta)); font-weight: 700; }
.help-diagnostics-grid dd { margin: 3px 0 0; overflow-wrap: anywhere; font-weight: 700; }
.help-user-agent { margin: 0; padding: 12px 14px; overflow-wrap: anywhere; font-family: ui-monospace, SFMono-Regular, Consolas, monospace; font-size: calc(12px + var(--interface-font-delta)); }
.help-submit-actions { display: flex; align-items: center; gap: 14px; }
.help-submit-actions p { margin: 0; color: #68707b; }
.help-request-list,
.help-admin-request-list { display: grid; gap: 13px; margin-top: 16px; }
.help-request-card,
.help-admin-request-card { padding: 16px; border: 1px solid #dfe3e7; border-left: 5px solid #7b8490; border-radius: 12px; background: #fbfbfc; }
.help-request-card.bug { border-left-color: #c90016; }
.help-request-card.improvement { border-left-color: #b47a00; }
.help-request-card-header h3 { margin: 4px 0 0; font-size: calc(18px + var(--interface-font-delta)); }
.help-request-code { color: #68707b; font-size: calc(12px + var(--interface-font-delta)); font-weight: 900; letter-spacing: .05em; }
.help-status-badge { flex: 0 0 auto; padding: 6px 10px; border-radius: 999px; font-size: calc(12px + var(--interface-font-delta)); font-weight: 900; background: #e9ecef; color: #4c545e; }
.help-status-badge.status-new { background: #ffe8eb; color: #a60012; }
.help-status-badge.status-analysis { background: #fff2ce; color: #795300; }
.help-status-badge.status-planned { background: #e8e4ff; color: #4a3993; }
.help-status-badge.status-in_progress { background: #dcecff; color: #145287; }
.help-status-badge.status-resolved,
.help-status-badge.status-implemented { background: #dcf4e3; color: #17662d; }
.help-status-badge.status-rejected { background: #eceff2; color: #555d66; }
.help-request-meta { display: flex; flex-wrap: wrap; gap: 7px; margin-top: 11px; }
.help-request-meta span { padding: 4px 8px; border-radius: 7px; background: #eef1f4; color: #59616b; font-size: calc(12px + var(--interface-font-delta)); font-weight: 700; }
.help-request-description,
.help-admin-request-copy p,
.help-request-benefit p,
.help-admin-response p { white-space: pre-wrap; overflow-wrap: anywhere; line-height: 1.48; }
.help-request-benefit,
.help-admin-response,
.help-admin-request-copy { margin-top: 12px; padding: 12px 13px; border-radius: 9px; background: #fff; border: 1px solid #e3e6e9; }
.help-admin-response { background: #f0f7ff; border-color: #cbdff5; }
.help-admin-response small,
.help-waiting-response,
.help-no-diagnostics { color: #68707b; }
.help-waiting-response { margin: 12px 0 0; font-style: italic; }
.help-faq-list { display: grid; gap: 9px; margin-top: 16px; }
.help-faq-item p { margin: 0; padding: 12px 14px; line-height: 1.5; color: #4f5862; }
.help-empty-state { display: flex; align-items: center; gap: 10px; margin-top: 15px; padding: 18px; border: 1px dashed #cfd4da; border-radius: 11px; color: #68707b; }
.help-empty-state span { display: grid; place-items: center; width: 30px; height: 30px; border-radius: 50%; background: #e1f4e6; color: #17662d; font-weight: 900; }
.help-empty-state p { margin: 0; }
.help-load-error { margin-top: 15px; padding: 12px; border-radius: 9px; background: #fff0f1; color: #9b0011; font-weight: 700; }
.help-admin-card { border-top: 4px solid #c90016; }
.help-admin-request-card { border-left-color: #c90016; }
.help-admin-request-card > p { margin: 12px 0 0; }
.help-admin-form { display: grid; grid-template-columns: minmax(170px, .45fr) minmax(280px, 1.55fr) auto; align-items: end; gap: 12px; margin-top: 15px; padding-top: 15px; border-top: 1px solid #e0e4e8; }
.help-admin-form button { min-height: 42px; }

html[data-theme="dark"] .help-intro-card p,
html[data-theme="dark"] .help-section-heading p,
html[data-theme="dark"] .help-type-choice small,
html[data-theme="dark"] .help-diagnostics-consent small,
html[data-theme="dark"] .help-submit-actions p,
html[data-theme="dark"] .help-admin-response small,
html[data-theme="dark"] .help-waiting-response,
html[data-theme="dark"] .help-no-diagnostics,
html[data-theme="dark"] .help-faq-item p { color: #b9c0c8; }
html[data-theme="dark"] .help-version-chip,
html[data-theme="dark"] .help-count-chip,
html[data-theme="dark"] .help-type-choice,
html[data-theme="dark"] .help-diagnostics-consent,
html[data-theme="dark"] .help-diagnostics-details,
html[data-theme="dark"] .help-faq-item,
html[data-theme="dark"] .help-request-card,
html[data-theme="dark"] .help-admin-request-card,
html[data-theme="dark"] .help-request-benefit,
html[data-theme="dark"] .help-admin-request-copy { background: #202124; border-color: #3a3d42; color: #f0f1f2; }
html[data-theme="dark"] .help-type-choice.is-selected { background: #321b20; border-color: #ef6373; }
html[data-theme="dark"] .help-request-form input,
html[data-theme="dark"] .help-request-form select,
html[data-theme="dark"] .help-request-form textarea,
html[data-theme="dark"] .help-admin-form select,
html[data-theme="dark"] .help-admin-form textarea,
html[data-theme="dark"] .help-diagnostics-grid > div { background: #17181a; border-color: #3a3d42; color: #f0f1f2; }
html[data-theme="dark"] .help-request-meta span { background: #303338; color: #d2d6da; }
html[data-theme="dark"] .help-admin-response { background: #172536; border-color: #2d4d70; }

@media (max-width: 760px) {
  .help-page { gap: 12px; }
  .help-page > .card { padding: 14px; border-radius: 12px; }
  .help-intro-card,
  .help-section-heading { gap: 10px; }
  .help-intro-card h2,
  .help-section-heading h2 { font-size: calc(22px + var(--interface-font-delta)); }
  .help-type-grid,
  .help-form-grid,
  .help-diagnostics-grid { grid-template-columns: 1fr; }
  .help-type-choice { padding: 13px; }
  .help-submit-actions { align-items: stretch; flex-direction: column; }
  .help-submit-actions button { width: 100%; min-height: 46px; }
  .help-request-card,
  .help-admin-request-card { padding: 13px; }
  .help-request-card-header { gap: 8px; }
  .help-request-card-header h3 { font-size: calc(16px + var(--interface-font-delta)); }
  .help-status-badge { padding: 5px 8px; }
  .help-admin-form { grid-template-columns: 1fr; align-items: stretch; }
  .help-admin-form button { width: 100%; }
}


/* ==========================================
   V2.68 — INTERAKTYWNY SAMOUCZEK
   ========================================== */
.help-tutorial-card { border-top: 4px solid #c90016; }
.tutorial-launch-grid { display: grid; grid-template-columns: minmax(0, 1fr); gap: 13px; margin-top: 16px; }
.tutorial-launch-grid.has-admin { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.tutorial-launch-card {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  grid-template-areas: "icon content" "button button";
  gap: 12px 14px;
  align-items: start;
  padding: 16px;
  border: 1px solid #dfe3e7;
  border-radius: 13px;
  background: #fafbfc;
}
.tutorial-launch-card.admin { background: #fff7f8; border-color: #edc8ce; }
.tutorial-launch-icon { grid-area: icon; display: grid; place-items: center; width: 44px; height: 44px; border-radius: 12px; background: #ffe8eb; font-size: calc(24px + var(--interface-font-delta)); }
.tutorial-launch-card > div { grid-area: content; }
.tutorial-launch-card h3 { margin: 0 0 5px; }
.tutorial-launch-card p { margin: 0; color: #68707b; line-height: 1.42; }
.tutorial-launch-card > button { grid-area: button; width: 100%; min-height: 42px; }
.tutorial-completion-state { display: inline-block; margin-top: 9px; color: #7b838d; font-weight: 800; }
.tutorial-completion-state.completed { color: #17662d; }

body.tutorial-active { overflow: hidden; }
.tutorial-overlay { position: fixed; inset: 0; z-index: 2147483000; pointer-events: none; }
.tutorial-backdrop { position: absolute; inset: 0; background: rgba(12, 16, 22, .64); backdrop-filter: blur(1px); }
.tutorial-popover {
  position: absolute;
  z-index: 3;
  left: max(16px, env(safe-area-inset-left));
  right: max(16px, env(safe-area-inset-right));
  bottom: max(16px, calc(env(safe-area-inset-bottom) + 10px));
  width: min(540px, calc(100vw - 32px));
  margin-left: auto;
  padding: 18px;
  border: 1px solid rgba(255,255,255,.2);
  border-radius: 16px;
  background: #fff;
  color: #252a30;
  box-shadow: 0 24px 70px rgba(0,0,0,.38);
  pointer-events: auto;
}
.tutorial-popover-top { display: flex; justify-content: space-between; gap: 12px; align-items: center; color: #68707b; font-size: calc(12px + var(--interface-font-delta)); font-weight: 900; text-transform: uppercase; letter-spacing: .06em; }
.tutorial-skip, .tutorial-later-button { border: 0; background: transparent; color: #59616b; font: inherit; font-weight: 800; cursor: pointer; text-decoration: underline; text-underline-offset: 3px; }
.tutorial-progress { height: 5px; margin: 13px 0 10px; overflow: hidden; border-radius: 999px; background: #e9ecef; }
.tutorial-progress i { display: block; height: 100%; border-radius: inherit; background: #c90016; transition: width .2s ease; }
.tutorial-step-count { color: #7a828b; font-size: calc(12px + var(--interface-font-delta)); font-weight: 800; }
.tutorial-popover h2 { margin: 5px 0 7px; font-size: calc(22px + var(--interface-font-delta)); }
.tutorial-popover p { margin: 0; color: #4f5862; line-height: 1.48; }
.tutorial-actions { display: flex; justify-content: space-between; gap: 10px; margin-top: 16px; }
.tutorial-actions button { min-width: 112px; }
.tutorial-highlighted {
  position: relative !important;
  z-index: 2147483002 !important;
  border-radius: 12px;
  outline: 4px solid #ffdd00 !important;
  outline-offset: 5px;
  box-shadow: 0 0 0 10px rgba(255, 221, 0, .20), 0 14px 38px rgba(0,0,0,.28) !important;
  background-clip: padding-box;
}
.tutorial-welcome-dialog { width: min(510px, calc(100vw - 28px)); }
.tutorial-welcome-dialog form { text-align: center; }
.tutorial-welcome-icon { display: grid; place-items: center; width: 62px; height: 62px; margin: 0 auto 13px; border-radius: 18px; background: #ffe8eb; font-size: calc(33px + var(--interface-font-delta)); }
.tutorial-welcome-dialog h2 { margin: 5px 0 9px; }
.tutorial-welcome-dialog p { margin: 0 auto; max-width: 430px; color: #59616b; line-height: 1.48; }
.tutorial-welcome-actions { display: grid; gap: 9px; margin-top: 18px; }
.tutorial-welcome-actions button { min-height: 43px; }
.tutorial-welcome-dialog small { display: block; margin-top: 12px; color: #7a828b; }

html[data-theme="dark"] .tutorial-launch-card { background: #181b20; border-color: #363b43; }

html[data-theme="dark"] .tutorial-launch-card p,
html[data-theme="dark"] .tutorial-popover p,
html[data-theme="dark"] .tutorial-welcome-dialog p { color: #b8bec7; }
html[data-theme="dark"] .tutorial-popover { background: #191c21; color: #f4f5f7; border-color: #414751; }
html[data-theme="dark"] .tutorial-progress { background: #343941; }
html[data-theme="dark"] .tutorial-skip,
html[data-theme="dark"] .tutorial-later-button { color: #c5cbd3; }
html[data-theme="dark"] .tutorial-welcome-icon,
html[data-theme="dark"] .tutorial-launch-icon { background: #401b20; }

@media (min-width: 900px) {
  .tutorial-popover { left: auto; right: 28px; bottom: 28px; }
}

@media (max-width: 760px) {
  .tutorial-launch-grid.has-admin { grid-template-columns: 1fr; }
  .tutorial-popover { padding: 15px; border-radius: 14px; }
  .tutorial-popover h2 { font-size: calc(19px + var(--interface-font-delta)); }
  .tutorial-popover p { font-size: calc(14px + var(--interface-font-delta)); }
  .tutorial-actions button { flex: 1 1 0; min-width: 0; }
  .tutorial-highlighted { outline-width: 3px !important; outline-offset: 3px; box-shadow: 0 0 0 6px rgba(255, 221, 0, .18) !important; }
}

@media (max-height: 650px) {
  .tutorial-popover { max-height: calc(100vh - 20px); overflow: auto; bottom: 10px; }
  .tutorial-popover p { font-size: calc(13px + var(--interface-font-delta)); }
}


/* ==========================================
   V2.68 FINAL — Pomoc, formularz dnia i minikalendarz tygodniowy
   ========================================== */
[hidden] { display: none !important; }

.week-picker { position: relative; width: 100%; min-width: 0; }
.week-range-button { border: 1px solid #ecc3c8; cursor: pointer; font: inherit; }
.week-range-button b { margin: 0 5px; color: #c90016; }
.week-picker-panel { width: 350px; }
.week-picker-header .week-picker-label {
  flex: 1 1 auto;
  padding: 6px 8px;
  color: #fff;
  background: transparent;
  border: 0;
  font-size: calc(17px + var(--interface-font-delta));
  font-weight: 900;
  cursor: pointer;
}
.week-picker-header .week-picker-label:hover { background: rgba(255,255,255,.12); border-radius: 7px; }
.week-picker-weeks { display: grid; gap: 7px; margin-top: 12px; }
.week-picker-weeks button {
  display: grid;
  grid-template-columns: 1fr auto;
  align-items: center;
  gap: 8px;
  width: 100%;
  padding: 10px 11px;
  color: #2e3339;
  background: #f5f6f7;
  border: 1px solid #e0e3e6;
  border-radius: 9px;
  text-align: left;
  cursor: pointer;
}
.week-picker-weeks button:hover,
.week-picker-weeks button.active { color: #9e0012; background: #fff0f2; border-color: #d98d97; }
.week-picker-weeks small { color: #6a727b; font-size: calc(10px + var(--interface-font-delta)); font-weight: 700; }
.week-picker-panel .miesiace button {
  padding: 11px 5px;
  color: #333;
  background: #f3f3f3;
  border: 0;
  border-radius: 8px;
  cursor: pointer;
}
.week-picker-panel .miesiace button.active,
.week-picker-panel .miesiace button:hover { color: #fff; background: #c8102e; }

.help-form-fields { display: grid; gap: 16px; }
.help-faq-link-card {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: 14px;
  color: inherit;
  text-decoration: none;
  transition: transform .15s ease, border-color .15s ease;
}
.help-faq-link-card:hover { transform: translateY(-1px); border-color: #c90016; }
.help-faq-link-icon { display: grid; place-items: center; width: 42px; height: 42px; border-radius: 12px; color: #fff; background: #c90016; font-size: calc(24px + var(--interface-font-delta)); font-weight: 900; }
.help-faq-link-card span:nth-child(2) { display: grid; gap: 2px; }
.help-faq-link-card small { color: #8a0010; font-size: calc(11px + var(--interface-font-delta)); font-weight: 900; text-transform: uppercase; letter-spacing: .05em; }
.help-faq-link-card strong { font-size: calc(19px + var(--interface-font-delta)); }
.help-faq-link-card em { color: #68707b; font-size: calc(13px + var(--interface-font-delta)); font-style: normal; line-height: 1.35; }
.help-faq-link-card > b { color: #c90016; font-size: calc(28px + var(--interface-font-delta)); }
.help-faq-page .help-faq-list { margin-top: 0; }

.day-status-grid.special-day-options { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.day-editor-section[hidden], .day-editor-summary[hidden] { display: none !important; }

html[data-theme="dark"] .week-picker-weeks button,
html[data-theme="dark"] .week-picker-panel .miesiace button { color: #eef0f3; background: #25282d; border-color: #3b4047; }
html[data-theme="dark"] .week-picker-weeks button.active,
html[data-theme="dark"] .week-picker-weeks button:hover,
html[data-theme="dark"] .week-picker-panel .miesiace button.active,
html[data-theme="dark"] .week-picker-panel .miesiace button:hover { color: #fff; background: #6f1621; border-color: #a64b57; }
html[data-theme="dark"] .help-faq-link-card em { color: #b9c0c8; }

@media (max-width: 760px) {
  .help-page { gap: 8px; }
  .help-page > .card { padding: 10px; border-radius: 10px; }
  .help-intro-card { align-items: center; }
  .help-intro-card h2, .help-section-heading h2 { margin: 1px 0 3px; font-size: calc(18px + var(--interface-font-delta)); line-height: 1.15; }
  .help-intro-card p, .help-section-heading p { font-size: calc(10.5px + var(--interface-font-delta)); line-height: 1.3; }
  .help-version-chip, .help-count-chip { min-height: 26px; padding: 0 8px; font-size: calc(10px + var(--interface-font-delta)); }
  .help-section-heading { gap: 7px; }
  .page-eyebrow { font-size: calc(9px + var(--interface-font-delta)); }
  .help-request-form { gap: 9px; margin-top: 9px; }
  .help-type-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 7px; }
  .help-type-choice {
    grid-template-columns: 25px minmax(0, 1fr);
    gap: 1px 6px;
    padding: 9px 7px;
    border-width: 1px;
    border-radius: 9px;
  }
  .help-type-icon { font-size: calc(20px + var(--interface-font-delta)); }
  .help-type-choice strong { font-size: calc(12px + var(--interface-font-delta)); line-height: 1.15; }
  .help-type-choice small { font-size: calc(9px + var(--interface-font-delta)); line-height: 1.2; }
  .help-form-fields { gap: 9px; }
  .help-form-grid { gap: 8px; }
  .help-request-form > label, .help-form-grid label, .help-admin-form label { gap: 4px; font-size: calc(11px + var(--interface-font-delta)); }
  .help-request-form input, .help-request-form select, .help-request-form textarea,
  .help-admin-form select, .help-admin-form textarea { padding: 8px 9px; border-radius: 8px; font-size: calc(12px + var(--interface-font-delta)); }
  .help-request-form textarea { min-height: 76px; }
  .help-diagnostics-consent { gap: 7px !important; padding: 8px; border-radius: 8px; }
  .help-diagnostics-consent input { width: 17px; height: 17px; }
  .help-diagnostics-consent strong { font-size: calc(11px + var(--interface-font-delta)); }
  .help-diagnostics-consent small { font-size: calc(9px + var(--interface-font-delta)); line-height: 1.25; }
  .help-diagnostics-details > summary, .help-faq-item > summary { padding: 9px 10px; font-size: calc(11px + var(--interface-font-delta)); }
  .help-diagnostics-grid { gap: 5px; padding: 7px; }
  .help-diagnostics-grid > div { padding: 6px 7px; }
  .help-diagnostics-grid dt { font-size: calc(9px + var(--interface-font-delta)); }
  .help-diagnostics-grid dd { font-size: calc(10px + var(--interface-font-delta)); }
  .help-submit-actions { gap: 5px; }
  .help-submit-actions button { min-height: 38px; font-size: calc(12px + var(--interface-font-delta)); }
  .help-request-list, .help-admin-request-list { gap: 8px; margin-top: 9px; }
  .help-request-card, .help-admin-request-card { padding: 9px; border-left-width: 3px; border-radius: 9px; }
  .help-request-card-header h3 { margin-top: 2px; font-size: calc(13px + var(--interface-font-delta)); }
  .help-request-code, .help-status-badge, .help-request-meta span { font-size: calc(9px + var(--interface-font-delta)); }
  .help-request-meta { gap: 4px; margin-top: 6px; }
  .help-request-meta span { padding: 3px 5px; }
  .help-request-description, .help-admin-request-copy p, .help-request-benefit p, .help-admin-response p { font-size: calc(10.5px + var(--interface-font-delta)); line-height: 1.35; }
  .help-request-benefit, .help-admin-response, .help-admin-request-copy { margin-top: 7px; padding: 8px; }
  .help-empty-state { margin-top: 8px; padding: 10px; font-size: calc(11px + var(--interface-font-delta)); }
  .help-empty-state span { width: 24px; height: 24px; }
  .help-faq-link-card { grid-template-columns: 32px minmax(0,1fr) auto; gap: 8px; }
  .help-faq-link-icon { width: 32px; height: 32px; border-radius: 9px; font-size: calc(18px + var(--interface-font-delta)); }
  .help-faq-link-card small { font-size: calc(8px + var(--interface-font-delta)); }
  .help-faq-link-card strong { font-size: calc(14px + var(--interface-font-delta)); }
  .help-faq-link-card em { font-size: calc(9px + var(--interface-font-delta)); line-height: 1.25; }
  .help-faq-link-card > b { font-size: calc(21px + var(--interface-font-delta)); }
  .tutorial-launch-grid { gap: 7px; margin-top: 8px; }
  .tutorial-launch-card { grid-template-columns: 32px minmax(0, 1fr) auto; grid-template-areas: "icon content button"; gap: 8px; align-items: center; padding: 8px; border-radius: 9px; }
  .tutorial-launch-icon { width: 32px; height: 32px; border-radius: 9px; font-size: calc(18px + var(--interface-font-delta)); }
  .tutorial-launch-card h3 { margin: 0 0 2px; font-size: calc(12px + var(--interface-font-delta)); }
  .tutorial-launch-card p { display: none; }
  .tutorial-completion-state { margin-top: 2px; font-size: calc(8px + var(--interface-font-delta)); }
  .tutorial-launch-card > button { width: auto; min-height: 30px; padding: 5px 7px; font-size: calc(9px + var(--interface-font-delta)); }
  .about-app-heading { gap: 8px; }
  .about-app-logo { width: 42px; height: 42px; }
  .about-app-title h2 { font-size: calc(17px + var(--interface-font-delta)); }
  .about-app-title p { font-size: calc(10px + var(--interface-font-delta)); }
  .about-app-meta { gap: 4px; }
  .about-app-meta span { padding: 4px 6px; font-size: calc(9px + var(--interface-font-delta)); }
  .about-app-author { margin-top: 8px; padding: 7px 8px; }
  .about-app-author span, .about-app-author strong { font-size: calc(10px + var(--interface-font-delta)); }
  .about-app-details { margin-top: 8px; }
  .about-app-details summary { padding: 8px; font-size: calc(10px + var(--interface-font-delta)); }
  .week-picker-panel { width: min(330px, calc(100vw - 28px)); padding: 10px; }
  .week-picker-header { padding: 5px; font-size: calc(15px + var(--interface-font-delta)); }
  .week-picker-header button { padding: 4px 6px; font-size: calc(15px + var(--interface-font-delta)); }
  .week-picker-header .week-picker-label { font-size: calc(14px + var(--interface-font-delta)); }
  .week-picker-weeks { gap: 5px; margin-top: 8px; }
  .week-picker-weeks button { padding: 8px; border-radius: 8px; font-size: calc(11px + var(--interface-font-delta)); }
  .week-picker-weeks small { font-size: calc(8px + var(--interface-font-delta)); }
  .week-picker-panel .miesiace { gap: 6px; margin-top: 8px; }
  .week-picker-panel .miesiace button { padding: 8px 3px; font-size: calc(10px + var(--interface-font-delta)); }
}


/* =========================================================
   V2.69 — czytelność, delegacja, gesty i ekran logowania
   ========================================================= */
.calendar-holiday-label {
    color: #a00012;
    font-weight: 900;
}

/* Dzienna wartość nadgodzin ma w ciemnym motywie dokładnie ten sam kolor
   co kafelek sumy nadgodzin. */
html[data-theme="dark"] .summary-overtime-cell.positive,
html[data-theme="dark"] .mobile-month-day > small,
html[data-theme="dark"] .mobile-week-day > small,
html[data-theme="dark"] .stats-mobile-day-meta > span strong:first-child {
    color: #ff9a54 !important;
}

/* Delegacja w weekend/święto zachowuje tło dnia specjalnego, ale jej
   oznaczenie używa konsekwentnie fioletowej palety delegacji. */
.mobile-special-state-mark.delegacja,
.mobile-week-special-badges em.delegacja {
    color: #4c2d91 !important;
    background: #f1eaff !important;
    border-color: #d3c2ef !important;
}

html[data-theme="dark"] .mobile-special-state-mark.delegacja,
html[data-theme="dark"] .mobile-week-special-badges em.delegacja {
    color: #d8c8ff !important;
    background: #2b2143 !important;
    border-color: #5d4b87 !important;
}

.period-swipe-surface {
    touch-action: pan-y pinch-zoom;
}

/* Oba odnośniki pod formularzem logowania mają identyczną geometrię.
   Rejestracja nie jest już czerwonym blokiem konkurującym z przyciskiem logowania. */
.auth-secondary-actions {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 9px;
    margin-top: 14px;
}

.auth-secondary-actions .auth-secondary-link {
    display: flex;
    min-width: 0;
    min-height: 46px;
    box-sizing: border-box;
    align-items: center;
    justify-content: flex-start;
    gap: 9px;
    margin: 0;
    padding: 9px 11px;
    color: #424247;
    background: #f7f7f8;
    border: 1px solid #dedee2;
    border-radius: 9px;
    font-size: calc(12px + var(--interface-font-delta));
    font-weight: 800;
    line-height: 1.18;
    text-align: left;
    text-decoration: none;
}

.auth-secondary-actions .auth-secondary-link:hover,
.auth-secondary-actions .auth-secondary-link:focus-visible {
    color: #8d0010;
    background: #fff5f6;
    border-color: #dfaab0;
    text-decoration: none;
}

.auth-secondary-actions .auth-register-link,
.auth-secondary-actions .auth-register-link:hover,
.auth-secondary-actions .auth-register-link:focus-visible {
    color: #8d0010;
    background: #fff5f6;
    border-color: #e5bdc2;
}

.auth-secondary-icon {
    display: grid;
    width: 25px;
    height: 25px;
    flex: 0 0 25px;
    place-items: center;
    color: #a90012;
    background: #fff;
    border: 1px solid #e3b7bc;
    border-radius: 7px;
    font-size: calc(15px + var(--interface-font-delta));
    font-weight: 900;
    line-height: 1;
}

html[data-theme="dark"] .calendar-holiday-label {
    color: #ff9ba6;
}

html[data-theme="dark"] .auth-secondary-actions .auth-secondary-link,
html[data-theme="dark"] .auth-secondary-actions .auth-register-link {
    color: var(--dark-text);
    background: #242428;
    border-color: #44444a;
}

html[data-theme="dark"] .auth-secondary-actions .auth-secondary-link:hover,
html[data-theme="dark"] .auth-secondary-actions .auth-secondary-link:focus-visible,
html[data-theme="dark"] .auth-secondary-actions .auth-register-link:hover,
html[data-theme="dark"] .auth-secondary-actions .auth-register-link:focus-visible {
    color: #ff9ba6;
    background: #321218;
    border-color: #693039;
}

html[data-theme="dark"] .auth-secondary-icon {
    color: #ff9ba6;
    background: #1f1f22;
    border-color: #603039;
}

@media (max-width: 430px) {
    .auth-secondary-actions {
        grid-template-columns: 1fr;
        gap: 7px;
    }

    .auth-secondary-actions .auth-secondary-link {
        min-height: 42px;
        padding: 8px 10px;
        font-size: calc(11.5px + var(--interface-font-delta));
    }

    .auth-secondary-icon {
        width: 23px;
        height: 23px;
        flex-basis: 23px;
        font-size: calc(14px + var(--interface-font-delta));
    }
}


/* V2.69 — anulowanie pracy/delegacji w weekend lub święto */
.special-day-cancel-wrap {
    margin-top: 10px;
}

.special-day-cancel-wrap[hidden] {
    display: none !important;
}

.special-day-cancel-button {
    display: flex;
    width: 100%;
    min-height: 48px;
    box-sizing: border-box;
    align-items: center;
    gap: 10px;
    padding: 9px 12px;
    color: #5d4700;
    background: #fff9df;
    border: 1px solid #e8d37b;
    border-radius: 10px;
    font: inherit;
    text-align: left;
    cursor: pointer;
}

.special-day-cancel-button > span:first-child {
    display: grid;
    width: 28px;
    height: 28px;
    flex: 0 0 28px;
    place-items: center;
    color: #725700;
    background: #fff;
    border: 1px solid #dfc65e;
    border-radius: 8px;
    font-size: calc(18px + var(--interface-font-delta));
    font-weight: 900;
}

.special-day-cancel-button > span:last-child {
    display: grid;
    min-width: 0;
    gap: 2px;
}

.special-day-cancel-button strong {
    font-size: calc(13px + var(--interface-font-delta));
    line-height: 1.2;
}

.special-day-cancel-button small {
    color: #776522;
    font-size: calc(11px + var(--interface-font-delta));
    line-height: 1.25;
}

.special-day-cancel-button:hover,
.special-day-cancel-button:focus-visible {
    background: #fff4bd;
    border-color: #caa72a;
    outline: none;
}

.special-day-cancel-button:disabled {
    opacity: .6;
    cursor: wait;
}

html[data-theme="dark"] .special-day-cancel-button {
    color: #ffe58c;
    background: #332c16;
    border-color: #655523;
}

html[data-theme="dark"] .special-day-cancel-button > span:first-child {
    color: #ffe58c;
    background: #242014;
    border-color: #6d5a22;
}

html[data-theme="dark"] .special-day-cancel-button small {
    color: #d6c47f;
}

html[data-theme="dark"] .special-day-cancel-button:hover,
html[data-theme="dark"] .special-day-cancel-button:focus-visible {
    background: #403619;
    border-color: #92782b;
}

@media (max-width: 600px) {
    .special-day-cancel-wrap {
        margin-top: 7px;
    }

    .special-day-cancel-button {
        min-height: 43px;
        gap: 8px;
        padding: 7px 9px;
        border-radius: 8px;
    }

    .special-day-cancel-button > span:first-child {
        width: 24px;
        height: 24px;
        flex-basis: 24px;
        border-radius: 7px;
        font-size: calc(16px + var(--interface-font-delta));
    }

    .special-day-cancel-button strong {
        font-size: calc(12px + var(--interface-font-delta));
    }

    .special-day-cancel-button small {
        font-size: calc(10px + var(--interface-font-delta));
    }
}


/* =========================================================
   V2.76 — delegacja specjalna, gesty całego ekranu i odświeżanie w tle
   ========================================================= */
@media (max-width: 800px) {
    .mobile-month-day.worked-special-day.special-delegation,
    .mobile-week-day.worked-special-day.special-delegation {
        box-shadow: inset 0 -3px 0 #7650bd !important;
    }

    .mobile-month-day.worked-special-day.special-delegation.is-today,
    .mobile-week-day.worked-special-day.special-delegation.is-today {
        box-shadow: inset 0 -3px 0 #7650bd, inset 0 0 0 1.5px #c90016 !important;
    }

    .mobile-month-day.worked-special-day.special-delegation .mobile-month-day-value,
    .mobile-week-day.worked-special-day.special-delegation .mobile-week-day-content > strong {
        color: #6940ae !important;
    }

    html[data-theme="dark"] .mobile-month-day.worked-special-day.special-delegation,
    html[data-theme="dark"] .mobile-week-day.worked-special-day.special-delegation {
        box-shadow: inset 0 -3px 0 #a98ae7 !important;
    }

    html[data-theme="dark"] .mobile-month-day.worked-special-day.special-delegation.is-today,
    html[data-theme="dark"] .mobile-week-day.worked-special-day.special-delegation.is-today {
        box-shadow: inset 0 -3px 0 #a98ae7, inset 0 0 0 1.5px #c90016 !important;
    }

    html[data-theme="dark"] .mobile-month-day.worked-special-day.special-delegation .mobile-month-day-value,
    html[data-theme="dark"] .mobile-week-day.worked-special-day.special-delegation .mobile-week-day-content > strong {
        color: #d8c8ff !important;
    }
}

#app.period-swipe-surface {
    min-height: calc(100dvh - 150px);
    touch-action: pan-y pinch-zoom;
}

.calendar-period-content {
    transition: opacity .14s ease;
}

.calendar-period-content.is-refreshing {
    opacity: .58;
    pointer-events: none;
}

#picker[aria-busy="true"] .picker-header button {
    opacity: .72;
}


/* V2.76 — aktualizacja z twardym limitem i bez blokowania na Service Workerze */
.app-update-modal .app-update-detail { margin-top: 8px; font-size: .82rem; opacity: .76; }


/* ==========================================
   V2.76 — Pomoc na podstronach, stabilny samouczek i mobilne okna
   ========================================== */
#app:focus,
#app:focus-visible {
  outline: none !important;
}

.help-type-links .help-type-link {
  position: relative;
  grid-template-columns: 42px minmax(0, 1fr) auto;
  grid-template-areas: "icon title arrow" "icon copy arrow";
  color: inherit;
  text-decoration: none;
}
.help-type-link .help-type-icon { grid-area: icon; }
.help-type-link strong { grid-area: title; }
.help-type-link small { grid-area: copy; }
.help-type-link > b {
  grid-area: arrow;
  align-self: center;
  color: #c90016;
  font-size: calc(27px + var(--interface-font-delta));
  line-height: 1;
}
.help-type-link:hover,
.help-type-link:focus-visible {
  transform: translateY(-1px);
  border-color: #c90016;
  box-shadow: 0 0 0 3px rgba(201, 0, 22, .08);
  outline: none;
}
.help-request-page .help-submit-card { margin-bottom: 0; }
.help-request-page .help-request-form { margin-top: 0; }

/* Popover jest zawsze nad podświetlanym elementem. Duże kontenery nie mogą zasłonić przycisków. */
.tutorial-overlay { z-index: 2147483646; }
.tutorial-highlighted { z-index: 2147483644 !important; }
.tutorial-popover {
  max-height: calc(100dvh - 24px);
  overflow: auto;
  overscroll-behavior: contain;
}
.tutorial-actions {
  position: sticky;
  z-index: 2;
  bottom: -18px;
  padding: 11px 0 4px;
  background: inherit;
}

html[data-theme="dark"] .help-type-link > b { color: #ff8492; }

@media (max-width: 760px) {
  .help-type-links .help-type-link {
    grid-template-columns: 27px minmax(0, 1fr) auto;
    grid-template-areas: "icon title arrow" "icon copy arrow";
  }
  .help-type-link > b { font-size: calc(19px + var(--interface-font-delta)); }
  .help-request-page .day-editor-topbar { margin-bottom: 7px; }
  .help-request-page .help-request-intro { padding: 10px; }
  .tutorial-popover {
    left: 10px;
    right: 10px;
    bottom: max(10px, env(safe-area-inset-bottom));
    width: auto;
    max-height: min(48dvh, 390px);
    padding: 13px;
  }
  .tutorial-popover-top { font-size: calc(10px + var(--interface-font-delta)); }
  .tutorial-progress { margin: 9px 0 7px; }
  .tutorial-step-count { font-size: calc(10px + var(--interface-font-delta)); }
  .tutorial-popover h2 { margin: 3px 0 5px; font-size: calc(17px + var(--interface-font-delta)); line-height: 1.18; }
  .tutorial-popover p { font-size: calc(12px + var(--interface-font-delta)); line-height: 1.35; }
  .tutorial-actions { margin-top: 9px; bottom: -13px; padding-top: 8px; }
  .tutorial-actions button { min-height: 36px; padding: 7px 10px; font-size: calc(12px + var(--interface-font-delta)); }
}

@media (max-height: 600px) {
  .tutorial-popover { max-height: calc(100dvh - 16px); }
}


/* =========================================================
   V2.76 — LOGO, SZYBKA ZMIANA, REFLEKTOR SAMOUCZKA I POMOC
   ========================================================= */
.help-tutorial-card,
.help-admin-card {
  border-top: 0;
}

/* Samouczek: tylko otoczenie wskazanego elementu jest rozmyte. */
.tutorial-overlay {
  position: fixed;
  inset: 0;
  z-index: 2147483000;
  pointer-events: none;
}
.tutorial-backdrop { display: none !important; }
.tutorial-shade {
  position: absolute;
  z-index: 1;
  background: rgba(12, 16, 22, .68);
  -webkit-backdrop-filter: blur(3px);
  backdrop-filter: blur(3px);
  pointer-events: auto;
}
.tutorial-focus-shield {
  position: absolute;
  z-index: 1;
  background: transparent;
  pointer-events: auto;
}
.tutorial-focus-ring {
  position: absolute;
  z-index: 2;
  border: 3px solid #ffdd00;
  border-radius: 13px;
  box-shadow: 0 0 0 5px rgba(255, 221, 0, .18), 0 12px 34px rgba(0,0,0,.3);
  pointer-events: none;
}
.tutorial-popover { z-index: 3; }
.tutorial-highlighted {
  position: relative !important;
  z-index: auto !important;
  outline: none !important;
  box-shadow: none !important;
}

@media (max-width: 760px) {
  .tutorial-focus-ring {
    border-width: 2px;
    border-radius: 10px;
    box-shadow: 0 0 0 4px rgba(255, 221, 0, .18), 0 10px 28px rgba(0,0,0,.28);
  }
}


/* =========================================================
   V2.79 — DOKŁADNY SAMOUCZEK, PIERWSZE URUCHOMIENIE I CO NOWEGO
   ========================================================= */
.tutorial-launch-card,
html[data-theme="dark"] .tutorial-launch-card {
  border-color: var(--card-border, #dfe2e6);
}
.tutorial-launch-card.admin { background: inherit; border-color: inherit; }
.tutorial-update-notes { margin-top: 12px; border: 1px solid #e1e4e8; border-radius: 12px; padding: 0 12px; }
.tutorial-update-notes summary { cursor: pointer; padding: 11px 0; font-weight: 850; }
.tutorial-update-notes ul, .whats-new-dialog ul { margin: 0 0 12px; padding-left: 20px; }
.tutorial-update-notes li, .whats-new-dialog li { margin: 5px 0; line-height: 1.42; }
.tutorial-shade {
  -webkit-backdrop-filter: none !important;
  backdrop-filter: none !important;
  background: rgba(9, 12, 17, .69);
}
.tutorial-focus-ring { box-sizing: border-box; }
.tutorial-popover { transition: top .12s ease, bottom .12s ease; }
.whats-new-dialog { width: min(520px, calc(100vw - 28px)); }
.whats-new-dialog h2 { margin: 5px 0 10px; }
html[data-theme="dark"] .tutorial-update-notes { border-color: #3a3f47; }
@media (max-width: 760px) {
  .tutorial-popover {
    left: 10px !important;
    right: 10px !important;
    bottom: auto !important;
    width: auto !important;
    max-height: min(46dvh, 360px);
  }
}


/* =========================================================
   V2.79 — pobyt w delegacji bez pracy
   ========================================================= */
.day-status-grid .delegation-stay-option {
  grid-column: 1 / -1;
  color: #4c2d91;
  background: #f6f1ff;
  border-color: #c8b7ee;
  justify-content: center;
}
.day-status-grid .delegation-stay-option input { accent-color: #7650c8; }
.day-status-grid .delegation-stay-option:has(input:checked) {
  color: #3f207f;
  background: #e7dafd;
  border-color: #7650c8;
}
#day-client-field[hidden] { display: none !important; }
html[data-theme="dark"] .day-status-grid .delegation-stay-option {
  color: #e4d7ff;
  background: #302543;
  border-color: #735ca0;
}
html[data-theme="dark"] .day-status-grid .delegation-stay-option:has(input:checked) {
  color: #fff;
  background: #4a3768;
  border-color: #b99ae9;
}
@media (max-width: 800px) {
  .mobile-month-day.special-delegation,
  .mobile-week-day.special-delegation {
    box-shadow: inset 0 -3px 0 #7650bd !important;
  }
  .mobile-month-day.special-delegation.is-today,
  .mobile-week-day.special-delegation.is-today {
    box-shadow: inset 0 -3px 0 #7650bd, inset 0 0 0 1.5px #c90016 !important;
  }
  html[data-theme="dark"] .mobile-month-day.special-delegation,
  html[data-theme="dark"] .mobile-week-day.special-delegation {
    box-shadow: inset 0 -3px 0 #a98ae7 !important;
  }
  html[data-theme="dark"] .mobile-month-day.special-delegation.is-today,
  html[data-theme="dark"] .mobile-week-day.special-delegation.is-today {
    box-shadow: inset 0 -3px 0 #a98ae7, inset 0 0 0 1.5px #c90016 !important;
  }
}


/* =========================================================
   V2.80 — jednakowa paleta zwykłej delegacji i delegacji bez pracy
   ========================================================= */
.day-status-grid .delegation-stay-option,
.day-status-grid .delegation-stay-option:has(input:checked) {
  color: #4c2d91;
  background: #f1eaff;
  border-color: #c8b7ee;
}
.day-status-grid .delegation-stay-option input {
  accent-color: #7650c8;
}
html[data-theme="dark"] .day-status-grid .delegation-stay-option,
html[data-theme="dark"] .day-status-grid .delegation-stay-option:has(input:checked) {
  color: #d8c8ff;
  background: #2b2143;
  border-color: #5d4b87;
}


/* =========================================================
   V2.81 — czytelne oznaczenie delegacji bez pracy w tabeli
   ========================================================= */
.calendar-summary-table .summary-day-row.has-delegation-stay > td:first-child {
  box-shadow: inset 5px 0 0 #7650c8;
}
.calendar-summary-table .summary-day-row.has-delegation-stay .summary-day-link,
.calendar-summary-table .summary-day-row.has-delegation-stay .summary-weekday-cell {
  color: #5a37a5;
}
.calendar-delegation-stay-label {
  display: inline-flex;
  align-items: center;
  padding: 2px 7px;
  color: #542f9b;
  background: #f1eaff;
  border: 1px solid #bda7e8;
  border-radius: 999px;
  font-size: calc(10px + var(--interface-font-delta));
  font-weight: 900;
  line-height: 1.2;
  white-space: nowrap;
}
html[data-theme="dark"] .calendar-summary-table .summary-day-row.has-delegation-stay > td:first-child {
  box-shadow: inset 5px 0 0 #a98ae7;
}
html[data-theme="dark"] .calendar-summary-table .summary-day-row.has-delegation-stay .summary-day-link,
html[data-theme="dark"] .calendar-summary-table .summary-day-row.has-delegation-stay .summary-weekday-cell {
  color: #cbb9ff;
}
html[data-theme="dark"] .calendar-delegation-stay-label {
  color: #dccfff;
  background: #2b2143;
  border-color: #725ba5;
}


/* =========================================================
   V2.83 — delegacja zachowuje tło weekendu lub święta
   ========================================================= */
.calendar-summary-table .summary-day-row.has-worked-delegation > td:first-child {
  box-shadow: inset 5px 0 0 #7650c8;
}
.calendar-summary-table .summary-day-row.has-worked-delegation .summary-day-link,
.calendar-summary-table .summary-day-row.has-worked-delegation .summary-weekday-cell,
.calendar-summary-table .summary-day-row.has-worked-delegation .summary-hours-cell strong,
.calendar-summary-table .summary-day-row.has-worked-delegation .summary-overtime-cell {
  color: #5a37a5 !important;
  font-weight: 900;
}
.calendar-special-delegation-note {
  display: inline-flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 5px;
}
.calendar-special-prefix-label {
  font-weight: 900;
}
.calendar-delegation-label {
  display: inline-flex;
  align-items: center;
  padding: 2px 7px;
  color: #542f9b;
  background: #f1eaff;
  border: 1px solid #bda7e8;
  border-radius: 999px;
  font-size: calc(10px + var(--interface-font-delta));
  font-weight: 900;
  line-height: 1.2;
  white-space: nowrap;
}
.calendar-note-separator {
  padding: 0 2px;
}
html[data-theme="dark"] .calendar-summary-table .summary-day-row.has-worked-delegation > td:first-child {
  box-shadow: inset 5px 0 0 #a98ae7;
}
html[data-theme="dark"] .calendar-summary-table .summary-day-row.has-worked-delegation .summary-day-link,
html[data-theme="dark"] .calendar-summary-table .summary-day-row.has-worked-delegation .summary-weekday-cell,
html[data-theme="dark"] .calendar-summary-table .summary-day-row.has-worked-delegation .summary-hours-cell strong,
html[data-theme="dark"] .calendar-summary-table .summary-day-row.has-worked-delegation .summary-overtime-cell {
  color: #d8c8ff !important;
}
html[data-theme="dark"] .calendar-delegation-label {
  color: #dccfff;
  background: #2b2143;
  border-color: #725ba5;
}


/* =========================================================
   V2.85 — standardowy kolor nadgodzin w delegacji specjalnej
   ========================================================= */
.calendar-summary-table .summary-day-row.has-worked-delegation .summary-overtime-cell.positive {
  color: #c90016 !important;
  font-weight: 700;
}
html[data-theme="dark"] .calendar-summary-table .summary-day-row.has-worked-delegation .summary-overtime-cell.positive {
  color: #ff9a54 !important;
}

/* =========================================================
   V2.85 — narzędzia kalendarza, filtry, powiadomienia i diagnostyka
   ========================================================= */
.header-notification-button {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 42px;
  min-width: 42px;
  height: 42px;
  padding: 0;
  color: inherit;
  text-decoration: none;
  background: rgba(0,0,0,.16);
  border: 1px solid rgba(255,255,255,.32);
  border-radius: 10px;
  font-size: calc(20px + var(--interface-font-delta));
}
.header-notification-button b,
.nav-tile-badge {
  position: absolute;
  top: -6px;
  right: -6px;
  min-width: 18px;
  height: 18px;
  padding: 0 4px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  background: #20242b;
  border: 2px solid #c90016;
  border-radius: 999px;
  font-size: calc(10px + var(--interface-font-delta));
  line-height: 1;
}
.notifications-nav-tile { position: relative; }
.notifications-page { max-width: 980px; margin-inline: auto; }
.notifications-list { display: grid; gap: 10px; margin-top: 16px; }
.notification-card {
  display: grid;
  grid-template-columns: 44px minmax(0,1fr) auto;
  gap: 12px;
  align-items: start;
  padding: 14px;
  border: 1px solid #ddd;
  border-radius: 12px;
  background: #fff;
}
.notification-card.is-unread { border-left: 5px solid #c90016; background: #fff8f9; }
.notification-card.is-read { opacity: .78; }
.notification-card.local { border-left-color: #7650c8; }
.notification-card-icon { display:flex; align-items:center; justify-content:center; width:40px; height:40px; border-radius:10px; background:#f0f1f3; font-size: calc(20px + var(--interface-font-delta)); }
.notification-card-copy > div { display:flex; gap:10px; justify-content:space-between; align-items:flex-start; }
.notification-card-copy strong { font-size: calc(15px + var(--interface-font-delta)); }
.notification-card-copy time { color:#777; font-size: calc(11px + var(--interface-font-delta)); white-space:nowrap; }
.notification-card-copy p { margin:6px 0 8px; line-height:1.45; }
.notification-card-copy a { color:#a80012; font-weight:800; text-decoration:none; }
.notification-read-button { align-self:center; color:#555; background:#f0f1f3; border:1px solid #d5d7db; }
.notifications-empty { padding:28px; text-align:center; color:#777; }

.calendar-tools { margin: 12px 0; }
.calendar-tools-primary { display:grid; grid-template-columns:repeat(4,minmax(0,1fr)); gap:9px; }
.calendar-tool-button {
  display:flex;
  align-items:center;
  gap:10px;
  min-width:0;
  min-height:58px;
  padding:10px 12px;
  text-align:left;
  color:#333;
  background:#f7f7f8;
  border:1px solid #dadce0;
  border-radius:11px;
}
.calendar-tool-button > span:first-child { flex:0 0 30px; font-size: calc(22px + var(--interface-font-delta)); text-align:center; }
.calendar-tool-button > span:last-child { min-width:0; display:grid; gap:2px; }
.calendar-tool-button strong { font-size: calc(13px + var(--interface-font-delta)); }
.calendar-tool-button small { overflow:hidden; color:#6b6e75; font-size: calc(10px + var(--interface-font-delta)); white-space:nowrap; text-overflow:ellipsis; }
.calendar-tool-button:hover, .calendar-tool-button.is-active { border-color:#c90016; background:#fff3f5; }
.calendar-tool-button.delegation { color:#4f3094; }
.calendar-bulk-bar {
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:12px;
  margin-top:10px;
  padding:10px 12px;
  color:#fff;
  background:#252933;
  border-radius:11px;
}
.calendar-bulk-bar > div { display:flex; flex-wrap:wrap; gap:7px; justify-content:flex-end; }
.calendar-tools-dialog { width:min(600px,calc(100vw - 24px)); max-height:min(88vh,760px); }
.calendar-tools-dialog form { max-height:inherit; overflow:auto; }
.calendar-tools-dialog label { display:grid; gap:5px; margin:10px 0; font-weight:700; }
.calendar-tools-dialog input:not([type="checkbox"]), .calendar-tools-dialog select, .calendar-tools-dialog textarea { width:100%; box-sizing:border-box; }
.calendar-filter-grid { display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); gap:8px; margin:12px 0; }
.calendar-filter-grid label { display:flex; align-items:center; gap:8px; margin:0; padding:10px; background:#f6f6f7; border:1px solid #dedfe2; border-radius:9px; }
.calendar-range-grid { display:grid; grid-template-columns:1fr 1fr; gap:10px; }
.dialog-note { padding:9px 11px; color:#555; background:#f5f5f6; border-radius:8px; font-size: calc(12px + var(--interface-font-delta)); line-height:1.4; }
.calendar-legend-list { display:grid; grid-template-columns:1fr 1fr; gap:8px; }
.calendar-legend-list > div { display:flex; align-items:center; gap:10px; padding:9px; border:1px solid #e0e0e0; border-radius:9px; }
.calendar-legend-list span { display:grid; gap:2px; }
.calendar-legend-list small { color:#777; }
.legend-swatch { width:28px; height:28px; flex:0 0 28px; border-radius:8px; border:1px solid rgba(0,0,0,.18); }
.legend-swatch.work { background:#f4f4f5; }
.legend-swatch.delegation { background:#7650c8; }
.legend-swatch.delegation-stay { background:linear-gradient(90deg,#7650c8 0 5px,#f1eaff 5px); }
.legend-swatch.leave { background:#daf3df; }
.legend-swatch.free { background:#eee4ad; }
.legend-swatch.weekend { background:#eee4ad; }
.legend-swatch.holiday { background:#ffd0d0; }
.legend-swatch.overtime { background:#ff9a54; }
.legend-swatch.missing { background:repeating-linear-gradient(135deg,#fff 0 5px,#f1b8bf 5px 10px); }
.legend-swatch.pending { background:linear-gradient(135deg,#2e89c7 0 50%,#fff 50%); }

.calendar-bulk-select-head,
.calendar-bulk-select-cell { display:none; width:38px; min-width:38px; padding:4px !important; }
.calendar-bulk-mode .calendar-bulk-select-head,
.calendar-bulk-mode .calendar-bulk-select-cell { display:table-cell; }
.calendar-bulk-select-cell button,
.mobile-bulk-select {
  width:27px;
  height:27px;
  min-width:27px;
  padding:0;
  color:#fff;
  background:transparent;
  border:2px solid #92959d;
  border-radius:8px;
}
.calendar-bulk-select-cell button[aria-pressed="true"],
.mobile-bulk-select[aria-pressed="true"] { background:#c90016; border-color:#c90016; }
.mobile-bulk-select { display:none; position:absolute; z-index:4; top:5px; right:5px; }
.calendar-bulk-mode .mobile-bulk-select { display:flex; align-items:center; justify-content:center; }
.calendar-bulk-mode [data-calendar-date] { cursor:pointer; }
[data-calendar-date].is-bulk-selected { outline:3px solid #c90016; outline-offset:-3px; }
.calendar-desktop-summary .calendar-filtered-out,
.mobile-week-calendar .calendar-filtered-out { display:none !important; }
.mobile-month-calendar .calendar-filtered-out { opacity:.22; filter:grayscale(1); }
.mobile-month-calendar .calendar-filtered-out .mobile-month-day-client,
.mobile-month-calendar .calendar-filtered-out .mobile-month-day-value,
.mobile-month-calendar .calendar-filtered-out small,
.mobile-month-calendar .calendar-filtered-out .mobile-special-state-mark { visibility:hidden; }
.has-pending-sync { position:relative; }
.has-pending-sync::after { content:""; position:absolute; right:4px; bottom:4px; width:8px; height:8px; background:#2e89c7; border:2px solid #fff; border-radius:50%; }
.calendar-summary-table .summary-day-row.has-delegation-stay > .summary-date-cell,
.calendar-summary-table .summary-day-row.has-worked-delegation > .summary-date-cell { box-shadow:inset 5px 0 0 #7650c8; }

.stats-filter-bar { display:flex; gap:9px; align-items:stretch; justify-content:flex-end; margin:10px 0; }
.stats-filter-bar .calendar-tool-button { width:min(330px,100%); }

.app-diagnostics-actions { display:flex; flex-wrap:wrap; gap:8px; margin-top:14px; }
.deployment-test-results { margin-top:12px; padding:12px; background:#f5f6f7; border:1px solid #ddd; border-radius:10px; }
.deployment-test-results ul { display:grid; gap:6px; margin:0; padding:0; list-style:none; }
.deployment-test-results li { display:flex; justify-content:space-between; gap:10px; padding:8px; background:#fff; border-radius:7px; }
.deployment-test-results li.ok strong { color:#17723b; }
.deployment-test-results li.error strong { color:#b00016; }
.deployment-test-results span { color:#666; font-size: calc(11px + var(--interface-font-delta)); text-align:right; }
.boot-rollback-error { color:#b00016; font-weight:700; }

html[data-theme="dark"] .notification-card { color:#eee; background:#1d1e21; border-color:#3b3d43; }
html[data-theme="dark"] .notification-card.is-unread { background:#281c20; }
html[data-theme="dark"] .notification-card-icon,
html[data-theme="dark"] .notification-read-button { color:#ddd; background:#303238; border-color:#4a4d55; }
html[data-theme="dark"] .notification-card-copy time,
html[data-theme="dark"] .notification-card-copy p,
html[data-theme="dark"] .notifications-empty { color:#b9bbc1; }
html[data-theme="dark"] .notification-card-copy a { color:#ff8fa0; }
html[data-theme="dark"] .calendar-tool-button { color:#eee; background:#202125; border-color:#3c3e45; }
html[data-theme="dark"] .calendar-tool-button small { color:#aeb0b7; }
html[data-theme="dark"] .calendar-tool-button:hover,
html[data-theme="dark"] .calendar-tool-button.is-active { background:#351d23; border-color:#e03249; }
html[data-theme="dark"] .calendar-filter-grid label,
html[data-theme="dark"] .dialog-note,
html[data-theme="dark"] .deployment-test-results { color:#ddd; background:#25262a; border-color:#3e4047; }
html[data-theme="dark"] .calendar-legend-list > div { border-color:#3e4047; }
html[data-theme="dark"] .calendar-legend-list small { color:#aaaeb6; }
html[data-theme="dark"] .deployment-test-results li { background:#1b1c20; }
html[data-theme="dark"] .legend-swatch.work { background:#222328; }

@media (max-width: 700px) {
  .header-notification-button { width:38px; min-width:38px; height:38px; }
  .calendar-tools-primary { grid-template-columns:1fr 1fr; gap:6px; }
  .calendar-tool-button { min-height:50px; padding:7px 8px; gap:6px; }
  .calendar-tool-button > span:first-child { flex-basis:25px; font-size: calc(18px + var(--interface-font-delta)); }
  .calendar-tool-button strong { font-size: calc(12px + var(--interface-font-delta)); }
  .calendar-tool-button small { font-size: calc(9px + var(--interface-font-delta)); }
  .calendar-bulk-bar { align-items:flex-start; flex-direction:column; }
  .calendar-bulk-bar > div { width:100%; justify-content:stretch; }
  .calendar-bulk-bar button { flex:1 1 auto; padding:7px 8px; font-size: calc(11px + var(--interface-font-delta)); }
  .calendar-filter-grid,
  .calendar-legend-list { grid-template-columns:1fr; }
  .calendar-range-grid { grid-template-columns:1fr 1fr; }
  .notification-card { grid-template-columns:36px minmax(0,1fr); padding:10px; gap:8px; }
  .notification-card-icon { width:34px; height:34px; }
  .notification-read-button { grid-column:2; justify-self:start; padding:6px 9px; font-size: calc(10px + var(--interface-font-delta)); }
  .notification-card-copy > div { display:grid; gap:2px; }
  .notification-card-copy time { white-space:normal; }
  .app-diagnostics-actions > button { flex:1 1 calc(50% - 8px); }
  .deployment-test-results li { display:grid; }
  .deployment-test-results span { text-align:left; }
  .stats-filter-bar { justify-content:stretch; }
  .stats-filter-bar .calendar-tool-button { width:100%; }
}


/* =========================================================
   V2.86 — kompaktowy dzwonek obok nazwy użytkownika
   ========================================================= */
.header-user-summary {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-width: 0;
}
.header-user-summary .header-user-name {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
}

@media (max-width: 760px) {
  header#app-header .header-user-summary {
    grid-row: 2;
    grid-column: 1;
    display: flex;
    align-items: center;
    min-width: 0;
    gap: 5px;
    padding-left: 1px;
  }
  header#app-header .header-user-summary .header-user-name {
    grid-row: auto;
    grid-column: auto;
    flex: 1 1 auto;
    max-width: none;
    padding-left: 0;
  }
  header#app-header .header-user-summary .header-notification-button {
    flex: 0 0 29px;
    width: 29px;
    min-width: 29px;
    height: 29px;
    border-radius: 8px;
    font-size: calc(15px + var(--interface-font-delta));
  }
  header#app-header .header-user-summary .header-notification-button b {
    top: -5px;
    right: -5px;
    min-width: 17px;
    height: 17px;
    padding-inline: 3px;
    font-size: calc(9px + var(--interface-font-delta));
  }
}


/* =========================================================
   V2.87 — wyraźniejsze kafelki dni w mobilnym widoku tygodnia
   ========================================================= */
@media (max-width: 760px) {
  .mobile-week-calendar {
    padding: 7px;
    gap: 8px;
    background: #eef1f4;
    border: 1px solid #d5d9de;
    border-radius: 12px;
  }

  .mobile-week-day {
    border-width: 1.5px;
    border-color: #c3c8ce;
    box-shadow:
      0 2px 5px rgba(20, 27, 34, 0.13),
      inset 0 1px 0 rgba(255, 255, 255, 0.72);
  }

  .mobile-week-day-heading {
    padding-bottom: 4px;
    border-bottom: 1px solid rgba(80, 88, 96, 0.18);
  }

  .mobile-week-day:active {
    transform: translateY(1px);
    box-shadow:
      0 1px 2px rgba(20, 27, 34, 0.12),
      inset 0 1px 0 rgba(255, 255, 255, 0.62);
  }

  html[data-theme="dark"] .mobile-week-calendar {
    background: #161a20;
    border-color: #39414b;
  }

  html[data-theme="dark"] .mobile-week-day {
    border-color: #4a535e;
    box-shadow:
      0 2px 6px rgba(0, 0, 0, 0.42),
      inset 0 1px 0 rgba(255, 255, 255, 0.04);
  }

  html[data-theme="dark"] .mobile-week-day-heading {
    border-bottom-color: rgba(220, 225, 232, 0.16);
  }

  html[data-theme="dark"] .mobile-week-day:active {
    box-shadow:
      0 1px 2px rgba(0, 0, 0, 0.38),
      inset 0 1px 0 rgba(255, 255, 255, 0.03);
  }
}


/* =========================================================
   V2.91 — wyraźniejsze kafelki dni w mobilnym widoku miesiąca
   ========================================================= */
@media (max-width: 760px) {
  .mobile-month-calendar {
    padding: 7px;
    gap: 6px;
    background: #eef1f4;
    border-color: #d5d9de;
    border-radius: 12px;
  }

  .mobile-month-calendar .mobile-calendar-days {
    gap: 5px;
  }

  .mobile-month-day {
    border-width: 1.5px;
    border-color: #c3c8ce;
    box-shadow:
      0 2px 5px rgba(20, 27, 34, 0.13),
      inset 0 1px 0 rgba(255, 255, 255, 0.72);
  }

  .mobile-month-day-top {
    padding-bottom: 3px;
    border-bottom: 1px solid rgba(80, 88, 96, 0.18);
  }

  .mobile-month-day:active {
    transform: translateY(1px);
    box-shadow:
      0 1px 2px rgba(20, 27, 34, 0.12),
      inset 0 1px 0 rgba(255, 255, 255, 0.62);
  }

  .mobile-month-day.is-today {
    box-shadow:
      0 2px 5px rgba(20, 27, 34, 0.13),
      inset 0 0 0 1.5px #c90016;
  }

  .mobile-month-day.worked-special-day {
    box-shadow:
      0 2px 5px rgba(20, 27, 34, 0.13),
      inset 0 -3px 0 #126a92;
  }

  .mobile-month-day.worked-special-day.special-delegation {
    box-shadow:
      0 2px 5px rgba(20, 27, 34, 0.13),
      inset 0 -3px 0 #7650bd !important;
  }

  .mobile-month-day.worked-special-day.is-today {
    box-shadow:
      0 2px 5px rgba(20, 27, 34, 0.13),
      inset 0 -3px 0 #126a92,
      inset 0 0 0 1.5px #c90016;
  }

  .mobile-month-day.worked-special-day.special-delegation.is-today {
    box-shadow:
      0 2px 5px rgba(20, 27, 34, 0.13),
      inset 0 -3px 0 #7650bd,
      inset 0 0 0 1.5px #c90016 !important;
  }

  html[data-theme="dark"] .mobile-month-calendar {
    background: #161a20;
    border-color: #39414b;
  }

  html[data-theme="dark"] .mobile-month-day {
    border-color: #4a535e;
    box-shadow:
      0 2px 6px rgba(0, 0, 0, 0.42),
      inset 0 1px 0 rgba(255, 255, 255, 0.04);
  }

  html[data-theme="dark"] .mobile-month-day-top {
    border-bottom-color: rgba(220, 225, 232, 0.16);
  }

  html[data-theme="dark"] .mobile-month-day:active {
    box-shadow:
      0 1px 2px rgba(0, 0, 0, 0.38),
      inset 0 1px 0 rgba(255, 255, 255, 0.03);
  }

  html[data-theme="dark"] .mobile-month-day.is-today {
    box-shadow:
      0 2px 6px rgba(0, 0, 0, 0.42),
      inset 0 0 0 1.5px #ff596b;
  }

  html[data-theme="dark"] .mobile-month-day.worked-special-day {
    box-shadow:
      0 2px 6px rgba(0, 0, 0, 0.42),
      inset 0 -3px 0 #126a92;
  }

  html[data-theme="dark"] .mobile-month-day.worked-special-day.special-delegation {
    box-shadow:
      0 2px 6px rgba(0, 0, 0, 0.42),
      inset 0 -3px 0 #a98ae7 !important;
  }

  html[data-theme="dark"] .mobile-month-day.worked-special-day.is-today {
    box-shadow:
      0 2px 6px rgba(0, 0, 0, 0.42),
      inset 0 -3px 0 #126a92,
      inset 0 0 0 1.5px #ff596b;
  }

  html[data-theme="dark"] .mobile-month-day.worked-special-day.special-delegation.is-today {
    box-shadow:
      0 2px 6px rgba(0, 0, 0, 0.42),
      inset 0 -3px 0 #a98ae7,
      inset 0 0 0 1.5px #ff596b !important;
  }
}

/* =========================================================
   V2.91 — mocniejsze odseparowanie kafelków w widoku miesiąca
   oraz wyraźna etykieta Weekend na pustych dniach weekendowych
   ========================================================= */
@media (max-width: 760px) {
  .mobile-month-calendar {
    padding: 8px;
    gap: 8px;
  }

  .mobile-month-calendar .mobile-calendar-days {
    gap: 6px;
  }

  .mobile-month-day {
    border-width: 1.5px;
    border-style: solid;
    border-color: #bfc6cf;
    box-shadow:
      0 2px 6px rgba(20, 27, 34, 0.14),
      inset 0 1px 0 rgba(255, 255, 255, 0.74);
  }

  .mobile-month-day-top {
    padding-bottom: 4px;
    margin-bottom: 1px;
    border-bottom: 1px solid rgba(80, 88, 96, 0.2);
  }

  .mobile-month-day-value {
    letter-spacing: 0.01em;
  }

  html[data-theme="dark"] .mobile-month-day {
    border-color: #48525e;
    box-shadow:
      0 2px 7px rgba(0, 0, 0, 0.45),
      inset 0 1px 0 rgba(255, 255, 255, 0.04);
  }

  html[data-theme="dark"] .mobile-month-day-top {
    border-bottom-color: rgba(220, 225, 232, 0.18);
  }
}

/* =========================================================
   V2.91 — plan delegacji, blokady miesięcy, widok roczny,
   podsumowanie zapisu i ulepszone powiadomienia
   ========================================================= */
.month-edit-access-panel {
  display: grid;
  gap: 8px;
  margin: 10px 0 12px;
}
.month-edit-access-item {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  border: 1px solid #d6dbe1;
  border-radius: 12px;
  background: #f7f8fa;
}
.month-edit-access-item.is-unlocked {
  border-color: #b8d8c3;
  background: #f1faf4;
}
.month-edit-access-item.is-locked {
  border-color: #d5d9df;
  background: #f4f5f7;
}
.month-edit-access-icon { font-size: 1.15rem; }
.month-edit-access-item > span:nth-child(2) { min-width: 0; }
.month-edit-access-item strong,
.month-edit-access-item small { display: block; }
.month-edit-access-item small { margin-top: 2px; color: #65707d; line-height: 1.35; }
.day-month-access { margin: 0 0 10px; }
.month-locked-day { position: relative; }
.month-locked-day::after {
  content: "🔒";
  position: absolute;
  top: 5px;
  right: 5px;
  z-index: 4;
  font-size: 0.66rem;
  line-height: 1;
  opacity: 0.76;
  pointer-events: none;
}
.calendar-summary-table tr.month-locked-day td:first-of-type { box-shadow: inset 3px 0 0 #8b949e; }
.day-editor-page.is-read-only-month .day-editor-card { border-color: #d1d6dc; }
.day-editor-page.is-read-only-month .day-form { opacity: 0.88; }
.day-editor-page.is-read-only-month input:disabled,
.day-editor-page.is-read-only-month textarea:disabled,
.day-editor-page.is-read-only-month select:disabled { opacity: 1; color: inherit; -webkit-text-fill-color: currentColor; }

.delegation-plan-dialog form { max-width: 590px; }
.delegation-plan-preview {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
  padding: 10px;
  border: 1px solid #d8cfed;
  border-radius: 12px;
  background: #f8f5ff;
}
.delegation-plan-preview > strong,
.delegation-plan-preview > p { grid-column: 1 / -1; margin: 0; }
.delegation-plan-preview > div {
  padding: 8px;
  border-radius: 9px;
  background: #fff;
  border: 1px solid #e5def3;
}
.delegation-plan-preview span,
.delegation-plan-preview b { display: block; }
.delegation-plan-preview span { color: #6c647b; font-size: 0.78rem; }
.delegation-plan-preview b { margin-top: 2px; color: #6848a7; }
.calendar-tool-button.annual { text-decoration: none; color: inherit; }

.day-saved-summary-dialog form { max-width: 520px; text-align: center; }
.saved-summary-check {
  display: inline-grid;
  place-items: center;
  width: 48px;
  height: 48px;
  margin-bottom: 4px;
  border-radius: 50%;
  background: #e8f7ed;
  color: #17823b;
  font-size: 1.6rem;
  font-weight: 800;
}
.saved-day-summary-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
  margin: 14px 0 10px;
  text-align: left;
}
.saved-day-summary-grid > div {
  padding: 10px;
  border: 1px solid #dde1e6;
  border-radius: 10px;
  background: #f8f9fa;
}
.saved-day-summary-grid span,
.saved-day-summary-grid strong { display: block; }
.saved-day-summary-grid span { color: #68727e; font-size: 0.78rem; }
.saved-day-summary-grid strong { margin-top: 3px; }
.saved-day-summary-grid .overtime strong { color: #c84b00; }
.saved-summary-sync { display: block; color: #5f6975; }

.annual-overview-page { padding: 16px; }
.annual-navigation {
  display: grid;
  grid-template-columns: minmax(100px, 1fr) auto minmax(100px, 1fr);
  align-items: center;
  gap: 10px;
  margin-bottom: 14px;
}
.annual-navigation > div { text-align: center; }
.annual-navigation h2 { margin: 0; }
.annual-summary-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
  margin-bottom: 12px;
}
.annual-summary-grid article {
  padding: 12px;
  border: 1px solid #d8dde3;
  border-radius: 12px;
  background: #f8f9fb;
}
.annual-summary-grid span,
.annual-summary-grid strong,
.annual-summary-grid small { display: block; }
.annual-summary-grid span { color: #68727e; font-size: 0.82rem; }
.annual-summary-grid strong { margin: 3px 0; font-size: 1.35rem; }
.annual-summary-grid small { color: #707986; }
.annual-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 14px;
  margin: 10px 0 14px;
  padding: 9px 10px;
  border: 1px solid #dce0e5;
  border-radius: 10px;
}
.annual-legend span { display: inline-flex; align-items: center; gap: 5px; font-size: 0.82rem; }
.annual-legend i { width: 12px; height: 12px; border-radius: 3px; background: #ddd; }
.annual-legend i.leave { background: #5d9e68; }
.annual-legend i.delegation { background: #7650bd; }
.annual-legend i.delegation-stay { background: linear-gradient(90deg, #7650bd 35%, #eee0a7 35%); }
.annual-legend i.weekend { background: #ead888; }
.annual-legend i.holiday { background: #d76a6a; }
.annual-months-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
}
.annual-month-card {
  min-width: 0;
  padding: 9px;
  border: 1px solid #d6dbe1;
  border-radius: 12px;
  background: #fff;
  box-shadow: 0 2px 6px rgba(20, 27, 34, 0.08);
}
.annual-month-heading a {
  display: flex;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 7px;
  color: inherit;
  text-decoration: none;
}
.annual-month-heading span { color: #747e89; font-size: 0.72rem; }
.annual-weekdays,
.annual-days { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 3px; }
.annual-weekdays { margin-bottom: 3px; color: #707a85; font-size: 0.65rem; text-align: center; }
.annual-day {
  position: relative;
  display: grid;
  place-items: center;
  min-height: 28px;
  border: 1px solid #e0e4e8;
  border-radius: 6px;
  background: #fafbfc;
  color: #2c333a;
  text-decoration: none;
  font-size: 0.72rem;
}
.annual-day b { position: absolute; right: 2px; bottom: 1px; color: #6848a7; font-size: 0.55rem; }
.annual-day.weekend { background: #fbf4cf; border-color: #ead888; }
.annual-day.holiday { background: #f9dddd; border-color: #e4a5a5; }
.annual-day.leave { background: #e4f2e6; border-color: #9cc7a3; }
.annual-day.delegation,
.annual-day.delegation-stay { box-shadow: inset 0 -3px 0 #7650bd; }
.annual-day.delegation-stay { box-shadow: inset 3px 0 0 #7650bd; }
.annual-day-empty { visibility: hidden; }

.notification-filter-bar {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin: 10px 0 12px;
}
.notification-filter-bar button {
  border: 1px solid #d4d9df;
  border-radius: 999px;
  padding: 6px 10px;
  background: #f5f6f8;
  color: #424b55;
  font: inherit;
  font-size: 0.82rem;
}
.notification-filter-bar button.is-active {
  border-color: #c90016;
  background: #fff0f2;
  color: #a80012;
  font-weight: 700;
}

html[data-theme="dark"] .month-edit-access-item,
html[data-theme="dark"] .annual-summary-grid article,
html[data-theme="dark"] .annual-month-card,
html[data-theme="dark"] .saved-day-summary-grid > div { background: #20252c; border-color: #414a55; }
html[data-theme="dark"] .month-edit-access-item.is-unlocked { background: #192b21; border-color: #356948; }
html[data-theme="dark"] .month-edit-access-item small,
html[data-theme="dark"] .annual-summary-grid span,
html[data-theme="dark"] .annual-summary-grid small,
html[data-theme="dark"] .annual-month-heading span,
html[data-theme="dark"] .saved-day-summary-grid span,
html[data-theme="dark"] .saved-summary-sync { color: #aab3be; }
html[data-theme="dark"] .delegation-plan-preview { background: #211a2e; border-color: #54416f; }
html[data-theme="dark"] .delegation-plan-preview > div { background: #292132; border-color: #56466c; }
html[data-theme="dark"] .delegation-plan-preview span { color: #bcb1cc; }
html[data-theme="dark"] .delegation-plan-preview b { color: #c2a8f1; }
html[data-theme="dark"] .annual-legend { border-color: #414953; }
html[data-theme="dark"] .annual-day { background: #242a31; border-color: #454e59; color: #e8ebee; }
html[data-theme="dark"] .annual-day.weekend { background: #4a4124; border-color: #75683a; }
html[data-theme="dark"] .annual-day.holiday { background: #512a2c; border-color: #85464a; }
html[data-theme="dark"] .annual-day.leave { background: #21402a; border-color: #467453; }
html[data-theme="dark"] .annual-day b { color: #c2a8f1; }
html[data-theme="dark"] .notification-filter-bar button { background: #252b32; border-color: #48515c; color: #d6dbe0; }
html[data-theme="dark"] .notification-filter-bar button.is-active { background: #3b1e23; border-color: #ff596b; color: #ff9aa5; }

@media (max-width: 760px) {
  .month-edit-access-item { grid-template-columns: auto minmax(0, 1fr) auto; padding: 8px; gap: 7px; }
  .month-edit-access-item button { padding: 7px 9px; min-width: auto; }
  .delegation-plan-preview { grid-template-columns: 1fr; }
  .delegation-plan-preview > strong,
  .delegation-plan-preview > p { grid-column: auto; }
  .saved-day-summary-grid { grid-template-columns: 1fr 1fr; }
  .annual-overview-page { padding: 10px; }
  .annual-navigation { grid-template-columns: 1fr auto 1fr; }
  .annual-navigation .month-side-button { min-width: 0; }
  .annual-summary-grid { grid-template-columns: 1fr; gap: 7px; }
  .annual-summary-grid article { padding: 9px 10px; }
  .annual-months-grid { grid-template-columns: 1fr; gap: 9px; }
  .annual-month-card { padding: 8px; }
  .annual-day { min-height: 34px; }
  .notification-filter-bar { overflow-x: auto; flex-wrap: nowrap; padding-bottom: 2px; }
  .notification-filter-bar button { flex: 0 0 auto; }
}

/* =========================================================
   V2.91 — uproszczony Kalendarz, Planowanie i Widok roczny
   w Statystykach
   ========================================================= */
.calendar-tools-compact .calendar-tools-primary {
  grid-template-columns: repeat(2, minmax(0, 1fr));
  max-width: 620px;
}

.planning-page {
  display: grid;
  gap: 18px;
}

.planning-page .page-heading-row {
  align-items: flex-start;
}

.planning-page .page-heading-row p {
  margin: 6px 0 0;
  color: #5d646c;
  line-height: 1.45;
}

.planning-menu-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
}

.planning-menu-card {
  min-height: 112px;
  display: grid;
  grid-template-columns: 44px minmax(0, 1fr) auto;
  align-items: center;
  gap: 12px;
  padding: 18px;
  border: 1px solid #d5d9de;
  border-radius: 12px;
  background: #fff;
  color: #252a30;
  text-decoration: none;
  box-shadow: 0 2px 7px rgba(20, 27, 34, 0.08);
  transition: transform .15s ease, box-shadow .15s ease, border-color .15s ease;
}

.planning-menu-card:hover,
.planning-menu-card:focus-visible {
  transform: translateY(-1px);
  border-color: #aeb5bd;
  box-shadow: 0 5px 14px rgba(20, 27, 34, 0.12);
}

.planning-menu-card > span {
  width: 44px;
  height: 44px;
  display: grid;
  place-items: center;
  border-radius: 11px;
  font-size: calc(24px + var(--interface-font-delta));
  background: #f0f2f5;
}

.planning-menu-card strong,
.planning-menu-card small {
  display: block;
}

.planning-menu-card strong {
  font-size: calc(17px + var(--interface-font-delta));
  line-height: 1.2;
}

.planning-menu-card small {
  margin-top: 5px;
  color: #646b73;
  line-height: 1.35;
}

.planning-menu-card > b {
  font-size: calc(28px + var(--interface-font-delta));
  font-weight: 400;
  color: #7b838c;
}

.planning-menu-card.delegation > span {
  background: #eee8fb;
  color: #6844aa;
}

.planning-menu-card.leave > span {
  background: #e5f4e8;
  color: #28743a;
}

.planning-range-form {
  width: min(720px, 100%);
  display: grid;
  gap: 14px;
  padding: 18px;
  border: 1px solid #d8dce1;
  border-radius: 12px;
  background: #fafbfc;
}

.planning-range-form > label {
  display: grid;
  gap: 6px;
  font-weight: 700;
}

.planning-range-form input,
.planning-range-form textarea {
  width: 100%;
}

.planning-form-actions {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  flex-wrap: wrap;
}

.planning-range-form .delegation-plan-preview {
  margin: 0;
}

.planning-range-form .leave-preview {
  border-color: #a9d2af;
  background: #f1faf2;
}

html[data-theme="dark"] .planning-page .page-heading-row p,
html[data-theme="dark"] .planning-menu-card small {
  color: #b7bec7;
}

html[data-theme="dark"] .planning-menu-card {
  background: #20252c;
  color: #f1f3f5;
  border-color: #414a55;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.34);
}

html[data-theme="dark"] .planning-menu-card:hover,
html[data-theme="dark"] .planning-menu-card:focus-visible {
  border-color: #626d79;
  box-shadow: 0 5px 15px rgba(0, 0, 0, 0.45);
}

html[data-theme="dark"] .planning-menu-card > b {
  color: #b8c0c9;
}

html[data-theme="dark"] .planning-menu-card.delegation > span {
  background: #34284f;
  color: #c5a9ff;
}

html[data-theme="dark"] .planning-menu-card.leave > span {
  background: #203c28;
  color: #91d59e;
}

html[data-theme="dark"] .planning-range-form {
  background: #1c2026;
  border-color: #3d4651;
}

html[data-theme="dark"] .planning-range-form .leave-preview {
  background: #182b1d;
  border-color: #416a49;
}

.annual-overview-page.stats-page {
  gap: 16px;
}

@media (max-width: 760px) {
  .calendar-tools-compact {
    margin-top: 6px;
  }

  .calendar-tools-compact .calendar-tools-primary {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 7px;
  }

  .calendar-tools-compact .calendar-tool-button {
    min-height: 58px;
  }

  .planning-page {
    gap: 12px;
  }

  .planning-page .page-heading-row {
    gap: 10px;
  }

  .planning-page .page-heading-row > .secondary-action-button {
    align-self: flex-start;
  }

  .planning-menu-grid {
    grid-template-columns: 1fr;
    gap: 9px;
  }

  .planning-menu-card {
    min-height: 82px;
    grid-template-columns: 38px minmax(0, 1fr) auto;
    gap: 10px;
    padding: 12px;
    border-radius: 10px;
  }

  .planning-menu-card > span {
    width: 38px;
    height: 38px;
    border-radius: 9px;
    font-size: calc(21px + var(--interface-font-delta));
  }

  .planning-menu-card strong {
    font-size: calc(15px + var(--interface-font-delta));
  }

  .planning-menu-card small {
    margin-top: 3px;
    font-size: calc(12px + var(--interface-font-delta));
  }

  .planning-menu-card > b {
    font-size: calc(23px + var(--interface-font-delta));
  }

  .planning-range-form {
    gap: 11px;
    padding: 12px;
    border-radius: 10px;
  }

  .planning-form-actions {
    position: sticky;
    bottom: max(8px, env(safe-area-inset-bottom));
    z-index: 5;
    padding: 8px;
    margin: 0 -4px -4px;
    border: 1px solid #d8dce1;
    border-radius: 10px;
    background: rgba(250, 251, 252, 0.96);
    backdrop-filter: blur(8px);
  }

  html[data-theme="dark"] .planning-form-actions {
    border-color: #3d4651;
    background: rgba(28, 32, 38, 0.96);
  }

  .stats-tabs {
    min-width: max-content;
  }

  .stats-tabs a {
    white-space: nowrap;
  }
}

/* =========================================================
   V2.92 — dopracowane formularze Dodaj delegację / Dodaj urlop
   ========================================================= */
.planning-form-page,
.planning-form-page * {
  min-width: 0;
}

.planning-form-page {
  overflow: hidden;
}

.planning-page-heading {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 12px;
}

.planning-page-heading > div {
  flex: 1 1 420px;
  min-width: 0;
}

.planning-back-link {
  flex: 0 0 auto;
  white-space: nowrap;
}

.planning-range-form {
  width: min(760px, 100%);
  max-width: 100%;
  display: grid;
  gap: 10px;
  padding: 0;
  border: 0;
  border-radius: 0;
  background: transparent;
  overflow: visible;
}

.planning-form-section {
  display: grid;
  gap: 12px;
  padding: 14px;
  border: 1px solid #d9dde2;
  border-radius: 11px;
  background: #fafbfc;
  box-shadow: 0 1px 3px rgba(20, 27, 34, 0.04);
  overflow: hidden;
}

.planning-section-heading {
  display: grid;
  grid-template-columns: 28px minmax(0, 1fr);
  align-items: center;
  gap: 9px;
}

.planning-section-heading > span {
  width: 28px;
  height: 28px;
  display: grid;
  place-items: center;
  border-radius: 8px;
  background: #eceff3;
  color: #414952;
  font-size: 0.8rem;
  font-weight: 800;
}

.planning-section-heading strong,
.planning-section-heading small {
  display: block;
}

.planning-section-heading strong {
  color: #282e35;
  font-size: 0.96rem;
  line-height: 1.2;
}

.planning-section-heading small {
  margin-top: 2px;
  color: #6b737d;
  font-size: 0.76rem;
  font-weight: 500;
  line-height: 1.3;
}

.planning-date-grid,
.planning-details-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  width: 100%;
}

.planning-form-section label,
.planning-details-grid label,
.planning-note-field {
  display: grid;
  gap: 6px;
  width: 100%;
  max-width: 100%;
  margin: 0;
  color: #343b43;
  font-size: 0.82rem;
  font-weight: 750;
}

.planning-form-section input:not([type="checkbox"]),
.planning-form-section textarea {
  display: block;
  width: 100%;
  max-width: 100%;
  min-width: 0;
  box-sizing: border-box;
  margin: 0;
}

.planning-form-section textarea {
  min-height: 72px;
  resize: vertical;
}

.planning-note-field {
  margin-top: 1px;
}

.planning-day-mode-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 9px;
  width: 100%;
}

.planning-day-mode {
  position: relative;
  width: 100%;
  min-height: 82px;
  display: grid;
  grid-template-columns: 24px minmax(0, 1fr);
  align-items: center;
  gap: 10px;
  padding: 11px;
  margin: 0;
  border: 1px solid #d5d9df;
  border-radius: 10px;
  background: #fff;
  color: #30363d;
  cursor: pointer;
  box-sizing: border-box;
  transition: border-color .15s ease, background .15s ease, box-shadow .15s ease, transform .15s ease;
  overflow: hidden;
}

.planning-day-mode:hover {
  border-color: #b9c0c8;
  box-shadow: 0 2px 6px rgba(20, 27, 34, 0.08);
}

.planning-day-mode:active {
  transform: translateY(1px);
}

.planning-day-mode > input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.planning-mode-check {
  width: 22px;
  height: 22px;
  display: grid;
  place-items: center;
  border: 2px solid #aeb5bd;
  border-radius: 7px;
  background: #fff;
  box-sizing: border-box;
}

.planning-mode-check::after {
  content: "";
  width: 9px;
  height: 5px;
  border-left: 2px solid transparent;
  border-bottom: 2px solid transparent;
  transform: rotate(-45deg) translateY(-1px);
}

.planning-mode-copy {
  min-width: 0;
}

.planning-mode-copy strong,
.planning-mode-copy small {
  display: block;
  overflow-wrap: anywhere;
}

.planning-mode-copy strong {
  font-size: 0.88rem;
  line-height: 1.2;
}

.planning-mode-copy small {
  margin-top: 4px;
  color: #69717a;
  font-size: 0.73rem;
  font-weight: 500;
  line-height: 1.3;
}

.planning-day-mode:has(input:focus-visible) {
  outline: 3px solid rgba(201, 0, 22, 0.2);
  outline-offset: 2px;
}

.planning-day-mode:has(input:checked) {
  border-color: #8461c1;
  background: #f7f3ff;
  box-shadow: inset 0 0 0 1px rgba(112, 75, 174, 0.12);
}

.planning-day-mode:has(input:checked) .planning-mode-check {
  border-color: #7550b5;
  background: #7550b5;
}

.planning-day-mode:has(input:checked) .planning-mode-check::after {
  border-color: #fff;
}

.planning-day-mode.stay-mode:has(input:checked) {
  border-color: #8461c1;
  background: #f7f3ff;
}

.planning-summary-card {
  width: 100%;
  max-width: 100%;
  box-sizing: border-box;
  margin: 0;
  padding: 12px;
  gap: 8px;
  border-radius: 10px;
  overflow: hidden;
}

.planning-summary-card > div {
  min-width: 0;
  padding: 9px;
  border-radius: 8px;
}

.planning-summary-card b,
.planning-summary-card span,
.planning-summary-card p {
  overflow-wrap: anywhere;
}

.planning-form-note {
  width: 100%;
  max-width: 100%;
  box-sizing: border-box;
  margin: 0;
  padding: 9px 11px;
  border-radius: 9px;
  line-height: 1.35;
  overflow-wrap: anywhere;
}

.planning-form-actions {
  width: 100%;
  max-width: 100%;
  box-sizing: border-box;
}

html[data-theme="dark"] .planning-form-section {
  background: #1c2026;
  border-color: #3d4651;
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.2);
}

html[data-theme="dark"] .planning-section-heading > span {
  background: #303741;
  color: #e2e6eb;
}

html[data-theme="dark"] .planning-section-heading strong,
html[data-theme="dark"] .planning-form-section label {
  color: #eef1f4;
}

html[data-theme="dark"] .planning-section-heading small,
html[data-theme="dark"] .planning-mode-copy small {
  color: #b7bec7;
}

html[data-theme="dark"] .planning-day-mode {
  background: #242a31;
  border-color: #46505b;
  color: #f0f2f5;
}

html[data-theme="dark"] .planning-day-mode:hover {
  border-color: #626d79;
  box-shadow: 0 2px 7px rgba(0, 0, 0, 0.34);
}

html[data-theme="dark"] .planning-mode-check {
  background: #1d2228;
  border-color: #77818c;
}

html[data-theme="dark"] .planning-day-mode:has(input:checked),
html[data-theme="dark"] .planning-day-mode.stay-mode:has(input:checked) {
  background: #2d2440;
  border-color: #9b78d6;
  box-shadow: inset 0 0 0 1px rgba(190, 158, 239, 0.08);
}

html[data-theme="dark"] .planning-day-mode:has(input:checked) .planning-mode-check {
  border-color: #aa86e4;
  background: #8c64ca;
}

@media (max-width: 760px) {
  .planning-form-page {
    gap: 10px;
  }

  .planning-page-heading {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: start;
    gap: 8px;
  }

  .planning-page-heading > div {
    min-width: 0;
  }

  .planning-page-heading h2 {
    font-size: 1.18rem;
  }

  .planning-page-heading p {
    margin-top: 4px;
    font-size: 0.79rem;
    line-height: 1.35;
  }

  .planning-back-link {
    min-height: 36px;
    padding: 7px 10px;
    font-size: 0.78rem;
  }

  .planning-range-form {
    gap: 8px;
  }

  .planning-form-section {
    gap: 10px;
    padding: 10px;
    border-radius: 10px;
  }

  .planning-section-heading {
    grid-template-columns: 25px minmax(0, 1fr);
    gap: 8px;
  }

  .planning-section-heading > span {
    width: 25px;
    height: 25px;
    border-radius: 7px;
    font-size: 0.72rem;
  }

  .planning-section-heading strong {
    font-size: 0.88rem;
  }

  .planning-section-heading small {
    font-size: 0.69rem;
  }

  .planning-date-grid,
  .planning-details-grid {
    gap: 7px;
  }

  .planning-form-section label,
  .planning-details-grid label,
  .planning-note-field {
    gap: 4px;
    font-size: 0.75rem;
  }

  .planning-form-section input:not([type="checkbox"]),
  .planning-form-section textarea {
    min-height: 40px;
    padding: 8px 9px;
    font-size: 0.86rem;
  }

  .planning-form-section textarea {
    min-height: 62px;
  }

  .planning-day-mode-grid {
    gap: 7px;
  }

  .planning-day-mode {
    min-height: 74px;
    grid-template-columns: 21px minmax(0, 1fr);
    gap: 8px;
    padding: 9px;
    border-radius: 9px;
  }

  .planning-mode-check {
    width: 20px;
    height: 20px;
    border-radius: 6px;
  }

  .planning-mode-copy strong {
    font-size: 0.79rem;
  }

  .planning-mode-copy small {
    margin-top: 3px;
    font-size: 0.66rem;
    line-height: 1.25;
  }

  .planning-summary-card {
    padding: 10px;
    gap: 6px;
  }

  .planning-summary-card > div {
    padding: 8px;
  }

  .planning-form-note {
    padding: 8px 9px;
    font-size: 0.72rem;
  }

  .planning-form-actions {
    position: sticky;
    bottom: max(6px, env(safe-area-inset-bottom));
    z-index: 5;
    display: grid;
    grid-template-columns: minmax(0, 0.8fr) minmax(0, 1.2fr);
    gap: 7px;
    padding: 7px;
    margin: 0;
  }

  .planning-form-actions > * {
    width: 100%;
    min-width: 0;
    justify-content: center;
    text-align: center;
  }
}

@media (max-width: 370px) {
  .planning-date-grid,
  .planning-details-grid,
  .planning-day-mode-grid {
    grid-template-columns: 1fr;
  }

  .planning-page-heading {
    grid-template-columns: 1fr;
  }

  .planning-back-link {
    justify-self: start;
  }
}

/* =========================================================
   V2.93 — szybkie Dzisiaj, Zaplanowane, ustawienia widoku
   i bardziej zwarta obsługa mobilna
   ========================================================= */
.header-today-button {
  position: relative;
  display: none;
  align-items: center;
  justify-content: center;
  width: 34px;
  min-width: 34px;
  height: 34px;
  padding: 0;
  color: #fff;
  text-decoration: none;
  background: rgba(0, 0, 0, .16);
  border: 1px solid rgba(255, 255, 255, .32);
  border-radius: 9px;
}
.header-today-button > span,
.today-nav-icon {
  display: grid;
  place-items: center;
  font-size: calc(11px + var(--interface-font-delta));
  font-weight: 900;
  line-height: 1;
}
.header-today-button::before,
.today-nav-icon::before {
  content: "";
  position: absolute;
  top: 5px;
  left: 7px;
  right: 7px;
  height: 3px;
  border-radius: 2px;
  background: currentColor;
  opacity: .72;
}
.today-nav-icon {
  position: relative;
  padding-top: 4px;
  border: 1.5px solid currentColor;
  border-radius: 6px;
  box-sizing: border-box;
}
.today-nav-icon::before { top: 3px; left: 4px; right: 4px; height: 2px; }

.planning-menu-card.planned > span {
  color: #315f85;
  background: #e4f0f8;
}
html[data-theme="dark"] .planning-menu-card.planned > span {
  color: #9acced;
  background: #203747;
}

.planned-periods-page { max-width: 900px; margin-inline: auto; }
.planned-periods-list { display: grid; gap: 11px; }
.planned-period-card {
  display: grid;
  grid-template-columns: 46px minmax(0, 1fr);
  gap: 12px;
  padding: 14px;
  border: 1px solid #d8dde3;
  border-left: 5px solid #7650c8;
  border-radius: 12px;
  background: #fff;
  box-shadow: 0 2px 7px rgba(25, 32, 40, .07);
}
.planned-period-card.leave { border-left-color: #3a974e; }
.planned-period-icon {
  width: 42px;
  height: 42px;
  display: grid;
  place-items: center;
  border-radius: 11px;
  background: #eee8fb;
  font-size: calc(22px + var(--interface-font-delta));
}
.planned-period-card.leave .planned-period-icon { background: #e5f4e8; }
.planned-period-copy { min-width: 0; display: grid; gap: 9px; }
.planned-period-title { display: flex; align-items: flex-start; justify-content: space-between; gap: 10px; }
.planned-period-title > div { min-width: 0; display: grid; gap: 2px; }
.planned-period-title span { color: #6745a6; font-size: calc(12px + var(--interface-font-delta)); font-weight: 900; text-transform: uppercase; letter-spacing: .04em; }
.planned-period-card.leave .planned-period-title span { color: #28743a; }
.planned-period-title strong { overflow-wrap: anywhere; font-size: calc(16px + var(--interface-font-delta)); }
.planned-period-title > b { flex: 0 0 auto; padding: 4px 7px; color: #5e6570; background: #f0f2f4; border-radius: 999px; font-size: calc(11px + var(--interface-font-delta)); }
.planned-period-metrics { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 7px; }
.planned-period-metrics span { display: grid; gap: 1px; padding: 7px 9px; border-radius: 8px; background: #f5f6f8; }
.planned-period-metrics small { color: #6d737b; font-size: calc(10px + var(--interface-font-delta)); }
.planned-period-metrics strong { font-size: calc(14px + var(--interface-font-delta)); }
.planned-period-copy > p { margin: 0; color: #616871; font-size: calc(12px + var(--interface-font-delta)); line-height: 1.4; }
.planned-period-actions { display: flex; flex-wrap: wrap; gap: 7px; }
.planned-period-actions > * { min-height: 34px; padding: 7px 10px; font-size: calc(11px + var(--interface-font-delta)); }
.planned-period-cancel { color: #a60014; background: #fff4f5; border: 1px solid #e7b5bc; }
.planned-periods-empty { display: grid; place-items: center; gap: 5px; padding: 28px 14px; text-align: center; border: 1px dashed #cdd2d8; border-radius: 12px; }
.planned-periods-empty > span { font-size: calc(28px + var(--interface-font-delta)); color: #298443; }
.planned-periods-empty p { margin: 0; color: #6a717a; }

html[data-theme="dark"] .planned-period-card { color: #eef0f3; background: #20252b; border-color: #424b55; border-left-color: #a98ae7; box-shadow: 0 2px 8px rgba(0, 0, 0, .35); }
html[data-theme="dark"] .planned-period-card.leave { border-left-color: #79c88a; }
html[data-theme="dark"] .planned-period-icon { background: #34284f; }
html[data-theme="dark"] .planned-period-card.leave .planned-period-icon { background: #203c28; }
html[data-theme="dark"] .planned-period-title span { color: #c4a9ff; }
html[data-theme="dark"] .planned-period-card.leave .planned-period-title span { color: #91d59e; }
html[data-theme="dark"] .planned-period-title > b,
html[data-theme="dark"] .planned-period-metrics span { color: #e7e9ed; background: #2d333a; }
html[data-theme="dark"] .planned-period-metrics small,
html[data-theme="dark"] .planned-period-copy > p,
html[data-theme="dark"] .planned-periods-empty p { color: #b8bec6; }
html[data-theme="dark"] .planned-period-cancel { color: #ff9dac; background: #3a2025; border-color: #71404a; }
html[data-theme="dark"] .planned-periods-empty { border-color: #48515c; }

.compact-settings-heading {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 14px;
}
.compact-settings-heading p { margin: 4px 0 0; }
.compact-settings-heading > span { flex: 0 0 auto; font-size: calc(25px + var(--interface-font-delta)); }
.density-choice-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 9px; margin-top: 13px; }
.density-choice {
  position: relative;
  display: grid;
  grid-template-columns: 30px minmax(0, 1fr) auto;
  align-items: center;
  gap: 8px;
  padding: 11px;
  border: 1px solid #d9dde2;
  border-radius: 10px;
  cursor: pointer;
}
.density-choice input { position: absolute; opacity: 0; pointer-events: none; }
.density-choice > span { display: grid; place-items: center; width: 30px; height: 30px; background: #f0f2f5; border-radius: 8px; font-size: calc(18px + var(--interface-font-delta)); }
.density-choice strong, .density-choice small { display: block; }
.density-choice strong { font-size: calc(13px + var(--interface-font-delta)); }
.density-choice small { grid-column: 2; color: #70767e; font-size: calc(10px + var(--interface-font-delta)); }
.density-choice > i { grid-row: 1 / 3; grid-column: 3; display: grid; place-items: center; width: 20px; height: 20px; color: transparent; border: 1px solid #cbd0d6; border-radius: 50%; font-style: normal; }
.density-choice.is-selected { border-color: #c90016; background: #fff5f6; }
.density-choice.is-selected > i { color: #fff; background: #c90016; border-color: #c90016; }
.notification-preference-list { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; margin-top: 13px; }
.notification-preference {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  min-width: 0;
  padding: 10px 11px;
  border: 1px solid #d9dde2;
  border-radius: 10px;
  cursor: pointer;
}
.notification-preference > span { min-width: 0; display: grid; gap: 2px; }
.notification-preference strong { font-size: calc(13px + var(--interface-font-delta)); }
.notification-preference small { color: #70767e; font-size: calc(10px + var(--interface-font-delta)); line-height: 1.3; }
.notification-preference input { position: absolute; opacity: 0; pointer-events: none; }
.notification-preference > i { position: relative; flex: 0 0 38px; width: 38px; height: 22px; border-radius: 999px; background: #c7ccd2; transition: background .15s ease; }
.notification-preference > i::after { content: ""; position: absolute; top: 3px; left: 3px; width: 16px; height: 16px; border-radius: 50%; background: #fff; box-shadow: 0 1px 3px rgba(0,0,0,.25); transition: transform .15s ease; }
.notification-preference input:checked + i { background: #c90016; }
.notification-preference input:checked + i::after { transform: translateX(16px); }
html[data-theme="dark"] .density-choice,
html[data-theme="dark"] .notification-preference { border-color: #424a54; background: #20252b; }
html[data-theme="dark"] .density-choice > span { background: #2d333a; }
html[data-theme="dark"] .density-choice small,
html[data-theme="dark"] .notification-preference small { color: #b5bbc3; }
html[data-theme="dark"] .density-choice.is-selected { border-color: #ff596b; background: #351f24; }

.saved-summary-auto-close { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-top: 12px; }
.saved-summary-auto-close > span { color: #70767e; font-size: calc(10px + var(--interface-font-delta)); }

/* Gęstość Kalendarza */
html[data-calendar-density="compact"] .mobile-month-calendar .mobile-calendar-days { gap: 4px; }
html[data-calendar-density="compact"] .mobile-month-day { min-height: 64px; padding: 5px; }
html[data-calendar-density="compact"] .mobile-month-day-client { display: none; }
html[data-calendar-density="compact"] .mobile-month-day-value { font-size: calc(10px + var(--interface-font-delta)); }
html[data-calendar-density="compact"] .mobile-week-calendar { gap: 6px; }
html[data-calendar-density="compact"] .mobile-week-day { min-height: 74px; padding: 7px 9px; }
html[data-calendar-density="compact"] .mobile-week-day-content > span { max-width: 58%; font-size: calc(10px + var(--interface-font-delta)); }
html[data-calendar-density="compact"] .mobile-week-day-heading { padding-bottom: 2px; }
html[data-calendar-density="expanded"] .mobile-month-day { min-height: 91px; }
html[data-calendar-density="expanded"] .mobile-month-day-client { -webkit-line-clamp: 2; line-clamp: 2; }
html[data-calendar-density="expanded"] .mobile-week-day { min-height: 106px; }
html[data-calendar-density="expanded"] .mobile-week-day-content > span { white-space: normal; }
html[data-calendar-density="compact"] .calendar-summary-table td,
html[data-calendar-density="compact"] .calendar-summary-table th { padding-top: 6px; padding-bottom: 6px; }
html[data-calendar-density="expanded"] .calendar-summary-table td,
html[data-calendar-density="expanded"] .calendar-summary-table th { padding-top: 12px; padding-bottom: 12px; }

@media (max-width: 1319px) {
  .desktop-today-nav-tile { display: none !important; }
  .header-today-button { display: inline-flex; }
}
@media (min-width: 1320px) {
  .desktop-today-nav-tile { display: inline-flex; }
  .header-today-button { display: none; }
}
@media (max-width: 760px) {
  header#app-header .header-user-summary .header-today-button,
  header#app-header .header-user-summary .header-notification-button {
    flex: 0 0 29px;
    width: 29px;
    min-width: 29px;
    height: 29px;
    border-radius: 8px;
  }
  .header-today-button > span { padding-top: 4px; font-size: calc(9px + var(--interface-font-delta)); }
  .header-today-button::before { top: 4px; left: 6px; right: 6px; height: 2px; }
  .planned-periods-page { gap: 11px; }
  .planned-periods-list { gap: 8px; }
  .planned-period-card { grid-template-columns: 36px minmax(0, 1fr); gap: 9px; padding: 10px; border-radius: 10px; }
  .planned-period-icon { width: 34px; height: 34px; border-radius: 9px; font-size: calc(18px + var(--interface-font-delta)); }
  .planned-period-title { gap: 6px; }
  .planned-period-title strong { font-size: calc(14px + var(--interface-font-delta)); }
  .planned-period-title > b { padding: 3px 6px; font-size: calc(9px + var(--interface-font-delta)); }
  .planned-period-metrics { gap: 5px; }
  .planned-period-metrics span { padding: 5px 7px; }
  .planned-period-actions > * { flex: 1 1 auto; text-align: center; }
  .density-choice-grid { grid-template-columns: 1fr; gap: 6px; }
  .density-choice { grid-template-columns: 28px minmax(0, 1fr) auto; padding: 8px 9px; }
  .density-choice > span { width: 28px; height: 28px; font-size: calc(16px + var(--interface-font-delta)); }
  .notification-preference-list { grid-template-columns: 1fr; gap: 6px; }
  .notification-preference { padding: 8px 9px; }
  .compact-settings-heading > span { font-size: calc(21px + var(--interface-font-delta)); }
  .saved-summary-auto-close { margin-top: 9px; }
}

/* =========================================================
   V2.94 — szkice, konflikty, obecność i preferowany Kalendarz
   ========================================================= */
.day-edit-presence-notice {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 10px 0;
  padding: 10px 12px;
  border: 1px solid #d89b1d;
  border-radius: 10px;
  background: #fff7df;
  color: #5f4300;
}
.day-edit-presence-notice > span:first-child {
  display: grid;
  place-items: center;
  flex: 0 0 28px;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: #d89b1d;
  color: #fff;
  font-weight: 800;
}
.day-edit-presence-notice strong,
.day-edit-presence-notice small { display: block; }
.day-edit-presence-notice small { margin-top: 2px; }
.day-draft-notice.server-changed {
  border-color: #d89b1d;
  background: #fff8e8;
}
.day-conflict-dialog form { max-width: 520px; }
.day-conflict-actions { flex-wrap: wrap; }
.day-conflict-actions button { flex: 1 1 145px; }
.preferred-calendar-choice-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}
.preferred-calendar-choice {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  min-width: 0;
  padding: 11px 12px;
  border: 1px solid #d4d8dd;
  border-radius: 10px;
  background: #f7f8fa;
  cursor: pointer;
}
.preferred-calendar-choice input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}
.preferred-calendar-choice span,
.preferred-calendar-choice strong,
.preferred-calendar-choice small { display: block; min-width: 0; }
.preferred-calendar-choice small { margin-top: 2px; color: #68717b; }
.preferred-calendar-choice i {
  display: grid;
  place-items: center;
  flex: 0 0 24px;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: #dfe3e8;
  color: transparent;
  font-style: normal;
}
.preferred-calendar-choice.is-selected {
  border-color: #c90016;
  background: #fff3f5;
  box-shadow: inset 0 0 0 1px #c90016;
}
.preferred-calendar-choice.is-selected i { background: #c90016; color: #fff; }
.diagnostic-problem { color: #b54a00 !important; font-weight: 700; }
html[data-theme="dark"] .day-edit-presence-notice {
  border-color: #a87817;
  background: #332a13;
  color: #ffe4a2;
}
html[data-theme="dark"] .day-draft-notice.server-changed {
  border-color: #a87817;
  background: #2d281b;
}
html[data-theme="dark"] .preferred-calendar-choice {
  border-color: #454d57;
  background: #20252b;
}
html[data-theme="dark"] .preferred-calendar-choice small { color: #aeb6c0; }
html[data-theme="dark"] .preferred-calendar-choice i { background: #3a424c; }
html[data-theme="dark"] .preferred-calendar-choice.is-selected {
  border-color: #ff596b;
  background: #351f24;
  box-shadow: inset 0 0 0 1px #ff596b;
}
html[data-theme="dark"] .preferred-calendar-choice.is-selected i { background: #ff596b; }
html[data-theme="dark"] .diagnostic-problem { color: #ffb25f !important; }
@media (max-width: 760px) {
  .day-edit-presence-notice { padding: 8px 9px; gap: 8px; font-size: .92rem; }
  .preferred-calendar-choice-grid { gap: 7px; }
  .preferred-calendar-choice { padding: 9px; }
  .preferred-calendar-choice small { font-size: .74rem; line-height: 1.2; }
  .day-conflict-actions { display: grid; grid-template-columns: 1fr; }
  .day-conflict-actions button { width: 100%; }
}


/* =========================================================
   V2.95 — niezawodna nawigacja Dzisiaj i menu mobilne
   ========================================================= */
@media (max-width: 760px) {
  header#app-header .mobile-nav-toggle {
    z-index: 4;
    pointer-events: auto;
    touch-action: manipulation;
  }
  header#app-header nav {
    z-index: 3;
    pointer-events: auto;
  }
  .day-editor-page {
    position: relative;
    z-index: 0;
  }
}

/* =========================================================
   V2.97 — płynna nawigacja SPA formularza dnia
   ========================================================= */
header#app-header {
  isolation: isolate;
}

@media (max-width: 760px) {
  header#app-header {
    z-index: 2000;
  }
  header#app-header .mobile-nav-toggle {
    position: relative;
    z-index: 2002;
    pointer-events: auto;
    touch-action: manipulation;
  }
  header#app-header nav {
    z-index: 2001;
  }
  .day-save-dock-actions > a,
  .day-save-dock-actions > button,
  .back-to-calendar-button {
    position: relative;
    pointer-events: auto;
    touch-action: manipulation;
  }
}


/* V2.98 — wielkość interfejsu i edycja zaplanowanych okresów */
.interface-scale-choice-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
}
.interface-scale-choice {
  position: relative;
  display: grid;
  justify-items: center;
  gap: 5px;
  padding: 13px 8px;
  border: 1px solid #d9d9d9;
  border-radius: 12px;
  background: var(--surface, #fff);
  cursor: pointer;
  text-align: center;
}
.interface-scale-choice input { position: absolute; opacity: 0; pointer-events: none; }
.interface-scale-choice.is-selected { border-color: #c90016; box-shadow: 0 0 0 2px rgba(201,0,22,.12); }
.interface-scale-choice > i { position: absolute; top: 7px; right: 8px; color: #c90016; opacity: 0; font-style: normal; }
.interface-scale-choice.is-selected > i { opacity: 1; }
.interface-scale-choice small { color: #6b6b6b; }
.interface-scale-preview { display: grid; place-items: center; min-width: 45px; min-height: 32px; border-radius: 8px; background: rgba(201,0,22,.08); color: #a90013; font-weight: 700; }
.interface-scale-preview.small { font-size: calc(12px + var(--interface-font-delta)); }
.interface-scale-preview.standard { font-size: calc(16px + var(--interface-font-delta)); }
.interface-scale-preview.large { font-size: calc(20px + var(--interface-font-delta)); }
.planned-period-edit { border-color: rgba(201,0,22,.32); }
.planning-edit-page .planning-form-note { border-left: 3px solid #c90016; padding-left: 10px; }
html[data-theme="dark"] .interface-scale-choice { border-color: #3b3b3f; background: #1b1b1e; }
html[data-theme="dark"] .interface-scale-choice small { color: #b8b8bd; }
@media (max-width: 650px) {
  .interface-scale-choice-grid { grid-template-columns: 1fr; gap: 7px; }
  .interface-scale-choice { grid-template-columns: 48px 1fr 24px; justify-items: start; text-align: left; align-items: center; }
  .interface-scale-choice strong, .interface-scale-choice small { grid-column: 2; }
  .interface-scale-choice > i { position: static; grid-column: 3; grid-row: 1 / span 2; justify-self: center; }
  .planned-period-actions { flex-wrap: wrap; }
  .planned-period-actions > * { flex: 1 1 calc(50% - 6px); }
}

.planning-edit-days-panel {
  border: 1px solid #dedede;
  border-radius: 12px;
  background: rgba(0,0,0,.015);
  overflow: hidden;
}
.planning-edit-days-panel > summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 14px;
  cursor: pointer;
  list-style: none;
}
.planning-edit-days-panel > summary::-webkit-details-marker { display: none; }
.planning-edit-days-panel > summary span { display: grid; gap: 2px; }
.planning-edit-days-panel > summary small { color: #707070; font-weight: 400; }
.planning-edit-days-panel > summary b { min-width: 48px; padding: 4px 8px; border-radius: 999px; background: rgba(201,0,22,.09); color: #a90013; text-align: center; }
.planning-edit-days-list { display: grid; grid-template-columns: repeat(3,minmax(0,1fr)); gap: 7px; padding: 0 12px 12px; }
.planning-edit-day { position: relative; display: grid; grid-template-columns: 1fr 20px; align-items: center; gap: 6px; padding: 9px 10px; border: 1px solid #dedede; border-radius: 9px; background: #fff; cursor: pointer; }
.planning-edit-day input { position: absolute; opacity: 0; pointer-events: none; }
.planning-edit-day span { display: grid; gap: 2px; }
.planning-edit-day small { color: #707070; }
.planning-edit-day i { opacity: 0; color: #c90016; font-style: normal; font-weight: 700; }
.planning-edit-day:has(input:checked) { border-color: rgba(201,0,22,.48); background: rgba(201,0,22,.035); }
.planning-edit-day:has(input:checked) i { opacity: 1; }
html[data-theme="dark"] .planning-edit-days-panel { border-color: #3b3b3f; background: rgba(255,255,255,.02); }
html[data-theme="dark"] .planning-edit-day { border-color: #3b3b3f; background: #1b1b1e; }
html[data-theme="dark"] .planning-edit-days-panel small,
html[data-theme="dark"] .planning-edit-day small { color: #b8b8bd; }
@media (max-width: 760px) { .planning-edit-days-list { grid-template-columns: repeat(2,minmax(0,1fr)); } }
@media (max-width: 430px) { .planning-edit-days-list { grid-template-columns: 1fr; } }


/* =========================================================
   V2.99 — stały i czytelny stan synchronizacji
   ========================================================= */
.header-sync-button {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  min-width: 34px;
  height: 34px;
  padding: 0 9px;
  color: #fff;
  background: rgba(0, 0, 0, .16);
  border: 1px solid rgba(255, 255, 255, .34);
  border-radius: 9px;
  font: inherit;
  font-size: calc(11px + var(--interface-font-delta));
  font-weight: 800;
  line-height: 1;
  cursor: pointer;
  white-space: nowrap;
  touch-action: manipulation;
}
.header-sync-button:hover,
.header-sync-button:focus-visible {
  background: rgba(0, 0, 0, .27);
}
.header-sync-button.synced { box-shadow: inset 0 -3px 0 #65cf7b; }
.header-sync-button.saving,
.header-sync-button.syncing { box-shadow: inset 0 -3px 0 #ffe17a; }
.header-sync-button.waiting,
.header-sync-button.offline-pending { box-shadow: inset 0 -3px 0 #ffc14f; }
.header-sync-button.error { box-shadow: inset 0 -3px 0 #fff; }
.header-sync-button.offline { box-shadow: inset 0 -3px 0 #cfd3d8; }
.header-sync-icon {
  display: grid;
  place-items: center;
  flex: 0 0 20px;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: rgba(255,255,255,.16);
  font-size: calc(13px + var(--interface-font-delta));
  font-weight: 900;
}
.header-sync-button.saving .header-sync-icon,
.header-sync-button.syncing .header-sync-icon {
  animation: header-sync-spin .9s linear infinite;
}
.header-sync-count {
  position: absolute;
  top: -6px;
  right: -6px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 18px;
  height: 18px;
  padding: 0 4px;
  color: #fff;
  background: #20242b;
  border: 2px solid #c90016;
  border-radius: 999px;
  font-size: calc(9px + var(--interface-font-delta));
  line-height: 1;
}
@keyframes header-sync-spin {
  to { transform: rotate(360deg); }
}

.sync-status-dialog {
  width: min(570px, calc(100vw - 24px));
  max-height: min(760px, calc(100dvh - 24px));
  overflow: auto;
}
.sync-status-dialog form { display: grid; gap: 14px; }
.sync-dialog-heading {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 14px;
}
.sync-dialog-heading h2 { margin: 0; }
.sync-dialog-close {
  display: grid;
  place-items: center;
  flex: 0 0 34px;
  width: 34px;
  height: 34px;
  padding: 0;
  color: #5f5f5f;
  background: #f1f2f4;
  border: 1px solid #d8dadd;
  border-radius: 9px;
  font-size: calc(24px + var(--interface-font-delta));
  line-height: 1;
}
.sync-dialog-summary {
  display: grid;
  grid-template-columns: 42px minmax(0, 1fr);
  gap: 11px;
  align-items: center;
  padding: 12px;
  border: 1px solid #cfe3d3;
  border-radius: 12px;
  background: #f1faf3;
}
.sync-dialog-summary p { margin: 3px 0 0; color: #5d6460; line-height: 1.35; }
.sync-dialog-state-icon {
  display: grid;
  place-items: center;
  width: 42px;
  height: 42px;
  border-radius: 50%;
  color: #fff;
  background: #28853b;
  font-size: calc(22px + var(--interface-font-delta));
  font-weight: 900;
}
.sync-dialog-summary.saving,
.sync-dialog-summary.syncing {
  border-color: #e5c562;
  background: #fff9e7;
}
.sync-dialog-summary.saving .sync-dialog-state-icon,
.sync-dialog-summary.syncing .sync-dialog-state-icon {
  background: #b78000;
  animation: header-sync-spin .9s linear infinite;
}
.sync-dialog-summary.waiting,
.sync-dialog-summary.offline-pending {
  border-color: #e4bd67;
  background: #fff7e5;
}
.sync-dialog-summary.waiting .sync-dialog-state-icon,
.sync-dialog-summary.offline-pending .sync-dialog-state-icon { background: #a66a00; }
.sync-dialog-summary.offline {
  border-color: #cdd2d8;
  background: #f2f4f6;
}
.sync-dialog-summary.offline .sync-dialog-state-icon { background: #66717d; }
.sync-dialog-summary.error {
  border-color: #e2a8af;
  background: #fff1f3;
}
.sync-dialog-summary.error .sync-dialog-state-icon { background: #b00014; }
.sync-dialog-metrics {
  display: grid;
  grid-template-columns: 110px 130px minmax(0, 1fr);
  gap: 8px;
}
.sync-dialog-metrics > div {
  display: grid;
  gap: 4px;
  min-width: 0;
  padding: 10px;
  border: 1px solid #dedfe1;
  border-radius: 10px;
  background: #f8f9fa;
}
.sync-dialog-metrics span {
  color: #6a6e73;
  font-size: calc(11px + var(--interface-font-delta));
  font-weight: 700;
}
.sync-dialog-metrics strong {
  min-width: 0;
  overflow-wrap: anywhere;
  font-size: calc(13px + var(--interface-font-delta));
}
.sync-dialog-queue {
  border: 1px solid #dfe1e4;
  border-radius: 10px;
  overflow: hidden;
}
.sync-dialog-queue > summary {
  padding: 10px 12px;
  cursor: pointer;
  font-weight: 800;
}
.sync-dialog-queue ol {
  display: grid;
  gap: 6px;
  margin: 0;
  padding: 0 10px 10px;
  list-style: none;
}
.sync-dialog-queue-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 9px;
  padding: 9px 10px;
  border: 1px solid #e1e2e4;
  border-radius: 9px;
  background: #fff;
}
.sync-dialog-queue-item span,
.sync-dialog-queue-item strong,
.sync-dialog-queue-item small { display: block; min-width: 0; }
.sync-dialog-queue-item small { margin-top: 2px; color: #6c7074; }
.sync-dialog-queue-item > b {
  flex: 0 0 auto;
  padding: 4px 7px;
  color: #785100;
  background: #fff1ca;
  border-radius: 999px;
  font-size: calc(10px + var(--interface-font-delta));
}
.sync-dialog-queue-item.blocked > b {
  color: #8d0010;
  background: #ffe3e7;
}
.sync-dialog-empty,
.sync-dialog-loading,
.sync-dialog-error {
  margin: 0;
  padding: 11px 12px;
  border-radius: 9px;
  background: #f3f4f5;
}
.sync-dialog-error { color: #8d0010; background: #fff0f2; }
.sync-dialog-actions { margin-top: 0; }

.offline-settings-badge.syncing {
  color: #704b00;
  background: #fff0bd;
  border-color: #e1bd4c;
}

html[data-theme="dark"] .sync-dialog-close {
  color: #e7e8ea;
  background: #292d32;
  border-color: #444a51;
}
html[data-theme="dark"] .sync-dialog-summary {
  border-color: #355c3c;
  background: #17291b;
}
html[data-theme="dark"] .sync-dialog-summary p { color: #b6c1b8; }
html[data-theme="dark"] .sync-dialog-summary.saving,
html[data-theme="dark"] .sync-dialog-summary.syncing,
html[data-theme="dark"] .sync-dialog-summary.waiting,
html[data-theme="dark"] .sync-dialog-summary.offline-pending {
  border-color: #715a20;
  background: #2b2515;
}
html[data-theme="dark"] .sync-dialog-summary.offline {
  border-color: #454c54;
  background: #20252a;
}
html[data-theme="dark"] .sync-dialog-summary.error {
  border-color: #743a42;
  background: #301c20;
}
html[data-theme="dark"] .sync-dialog-metrics > div,
html[data-theme="dark"] .sync-dialog-queue,
html[data-theme="dark"] .sync-dialog-queue-item {
  border-color: #3c4147;
  background: #202328;
}
html[data-theme="dark"] .sync-dialog-metrics span,
html[data-theme="dark"] .sync-dialog-queue-item small { color: #b4bac1; }
html[data-theme="dark"] .sync-dialog-empty,
html[data-theme="dark"] .sync-dialog-loading { background: #24282d; }
html[data-theme="dark"] .sync-dialog-error { color: #ffabb5; background: #351e22; }

@media (max-width: 1050px) {
  .header-sync-button {
    flex: 0 0 34px;
    width: 34px;
    min-width: 34px;
    padding: 0;
  }
  .header-sync-label { display: none; }
}
@media (max-width: 760px) {
  header#app-header .header-user-summary .header-sync-button {
    flex: 0 0 29px;
    width: 29px;
    min-width: 29px;
    height: 29px;
    padding: 0;
    border-radius: 8px;
  }
  .header-sync-icon {
    flex-basis: 17px;
    width: 17px;
    height: 17px;
    font-size: calc(11px + var(--interface-font-delta));
  }
  .header-sync-count {
    top: -5px;
    right: -5px;
    min-width: 17px;
    height: 17px;
    padding-inline: 3px;
  }
  .sync-status-dialog { padding: 15px; }
  .sync-dialog-metrics { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .sync-dialog-metrics > div:last-child { grid-column: 1 / -1; }
  .sync-dialog-queue-item { align-items: flex-start; }
}
@media (max-width: 390px) {
  header#app-header .header-user-summary { gap: 4px; }
  .sync-dialog-actions { display: grid; grid-template-columns: 1fr; }
  .sync-dialog-actions button { width: 100%; }
}


/* =========================================================
   V3.01 — rozszerzony panel stanu aplikacji
   ========================================================= */
.app-diagnostics-overview {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 9px;
  margin: 14px 0;
}
.diagnostic-overview-item {
  min-width: 0;
  display: grid;
  align-content: start;
  gap: 5px;
  padding: 11px;
  border: 1px solid #dfe1e4;
  border-radius: 11px;
  background: #f8f9fa;
}
.diagnostic-overview-item > span {
  color: #686d72;
  font-size: calc(10px + var(--interface-font-delta));
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: .035em;
}
.diagnostic-overview-item > strong {
  min-width: 0;
  overflow-wrap: anywhere;
  font-size: calc(13px + var(--interface-font-delta));
  line-height: 1.28;
}
.diagnostic-overview-item > small {
  color: #72767b;
  font-size: calc(10px + var(--interface-font-delta));
  line-height: 1.3;
}
.diagnostic-overview-item.ok { border-color: #bcdcc4; background: #f1faf3; }
.diagnostic-overview-item.working { border-color: #ead27d; background: #fff9e9; }
.diagnostic-overview-item.offline { border-color: #cdd2d8; background: #f2f4f6; }
.diagnostic-overview-item.warning { border-color: #e2a8af; background: #fff1f3; }
.app-diagnostics-grid .diagnostic-device-item { grid-column: span 2; }
.diagnostic-device-item dd {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 7px;
}
.diagnostic-device-item code {
  max-width: 100%;
  padding: 3px 6px;
  overflow-wrap: anywhere;
  color: #474b50;
  background: #eceef1;
  border-radius: 6px;
  font-size: calc(10px + var(--interface-font-delta));
}
.diagnostic-copy-button {
  min-height: 30px;
  padding: 5px 9px;
  color: #a90013;
  background: #fff;
  border: 1px solid rgba(201,0,22,.32);
  border-radius: 7px;
  font: inherit;
  font-size: calc(10px + var(--interface-font-delta));
  font-weight: 800;
  cursor: pointer;
}
.diagnostic-copy-button:hover,
.diagnostic-copy-button:focus-visible { border-color: #c90016; background: #fff5f6; }
html[data-theme="dark"] .diagnostic-overview-item { border-color: #3b3e44; background: #202226; }
html[data-theme="dark"] .diagnostic-overview-item.ok { border-color: #356943; background: #17291c; }
html[data-theme="dark"] .diagnostic-overview-item.working { border-color: #765f20; background: #2c2615; }
html[data-theme="dark"] .diagnostic-overview-item.offline { border-color: #4a4f56; background: #24272c; }
html[data-theme="dark"] .diagnostic-overview-item.warning { border-color: #7f3c46; background: #301b1f; }
html[data-theme="dark"] .diagnostic-overview-item > span,
html[data-theme="dark"] .diagnostic-overview-item > small { color: #b9bdc4; }
html[data-theme="dark"] .diagnostic-device-item code { color: #d9dce1; background: #292c31; }
html[data-theme="dark"] .diagnostic-copy-button { color: #ff9aa5; background: #1b1c20; border-color: #7a3d45; }
@media (max-width: 900px) {
  .app-diagnostics-overview { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 520px) {
  .app-diagnostics-overview { grid-template-columns: 1fr; gap: 7px; }
  .diagnostic-overview-item { padding: 9px 10px; }
  .app-diagnostics-grid .diagnostic-device-item { grid-column: auto; }
  .diagnostic-device-item dd { align-items: flex-start; }
}

/* =========================================================
   V3.01 — raporty miesięczne, plakietki i mobilny pasek
   ========================================================= */
.monthly-report-settings-form {
  display: grid;
  grid-template-columns: minmax(220px, 1fr) auto;
  gap: 12px;
  align-items: end;
  margin-top: 14px;
}
.monthly-report-settings-form > label:first-child { display: grid; gap: 6px; }
.monthly-report-enabled { grid-column: auto; }
.monthly-report-account-email {
  display: grid;
  gap: 3px;
  margin-top: 13px;
  padding: 10px 12px;
  border: 1px solid #d9dce1;
  border-radius: 9px;
  background: #f8f9fa;
  overflow-wrap: anywhere;
}
.monthly-report-account-email span { color: #666; font-size: .82rem; font-weight: 800; }
.monthly-report-account-email strong { font-size: .98rem; }
.monthly-report-account-email small { color: #70757c; }
.monthly-report-account-email.verified { border-color: #abd5b7; background: #f2fbf4; }
.monthly-report-account-email.unverified { border-color: #e1a4aa; background: #fff4f5; }
.monthly-report-history { display: grid; gap: 7px; margin-top: 13px; }
.monthly-report-history-item {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 3px;
  padding: 9px 11px;
  border: 1px solid #d9dce1;
  border-radius: 9px;
  background: #f8f9fa;
}
.monthly-report-history-item > div { display: flex; justify-content: space-between; gap: 10px; }
.monthly-report-history-item span { font-weight: 800; color: #555; }
.monthly-report-history-item small { overflow-wrap: anywhere; color: #70757c; }
.monthly-report-history-item.status-failed { border-color: #e1a4aa; background: #fff4f5; }
.monthly-report-history-item.status-auto_sent { border-color: #abd5b7; background: #f2fbf4; }
.header-notification-button b,
.nav-tile-badge,
.nav-notification-badge {
  box-shadow: 0 1px 4px rgba(0,0,0,.35);
  font-variant-numeric: tabular-nums;
}
.header-notification-button b:not([hidden]),
.nav-tile-badge:not([hidden]) { animation: v301-notification-badge-in .2s ease-out; }
@keyframes v301-notification-badge-in { from { transform: scale(.55); opacity: 0; } to { transform: scale(1); opacity: 1; } }

@media (max-width: 760px) {
  header#app-header > h1 { grid-row: 1; grid-column: 1; }
  header#app-header .header-logout-button { grid-row: 1; grid-column: 2; }
  header#app-header .header-close-button { grid-row: 1; grid-column: 3; }
  header#app-header .mobile-nav-toggle { grid-row: 1; grid-column: 4; }
  header#app-header .header-user-summary { grid-row: 2; grid-column: 1 / -1; }
  .monthly-report-settings-form { grid-template-columns: 1fr; gap: 9px; }
  .monthly-report-enabled { grid-column: auto; }
  .monthly-report-settings-form .btn-canon { width: 100%; }
  .monthly-report-history-item { padding: 8px 9px; }
}

html[data-theme="dark"] .monthly-report-account-email { background:#24262b; border-color:#454851; }
html[data-theme="dark"] .monthly-report-account-email span,
html[data-theme="dark"] .monthly-report-account-email small { color:#c6c8ce; }
html[data-theme="dark"] .monthly-report-account-email.verified { background:#1e2c22; border-color:#3f6d4b; }
html[data-theme="dark"] .monthly-report-account-email.unverified { background:#321f23; border-color:#74414a; }
html[data-theme="dark"] .monthly-report-history-item { background:#24262b; border-color:#454851; }
html[data-theme="dark"] .monthly-report-history-item span,
html[data-theme="dark"] .monthly-report-history-item small { color:#c6c8ce; }
html[data-theme="dark"] .monthly-report-history-item.status-failed { background:#321f23; border-color:#74414a; }
html[data-theme="dark"] .monthly-report-history-item.status-auto_sent { background:#1e2c22; border-color:#3f6d4b; }

/* =========================================================
   V3.01 — korekta układu nawigacji desktop / mobile
   ========================================================= */
@media (min-width: 1051px) {
  /* Na komputerze kafelek Powiadomienia zastępuje dodatkowy dzwonek. */
  header#app-header .header-notification-button {
    display: none !important;
  }

  /* W stałym menu komputerowym Dzisiaj jest zawsze kafelkiem. */
  header#app-header nav .desktop-today-nav-tile {
    display: inline-flex !important;
  }
  header#app-header .header-today-button {
    display: none !important;
  }
}

@media (max-width: 760px) {
  header#app-header {
    grid-template-columns: minmax(0, 1fr) auto auto;
  }

  header#app-header > h1 {
    grid-row: 1;
    grid-column: 1;
  }

  header#app-header .header-logout-button {
    grid-row: 1;
    grid-column: 2;
  }

  header#app-header .header-close-button {
    grid-row: 1;
    grid-column: 3;
  }

  /* Nazwa, synchronizacja, Dzisiaj i dzwonek zajmują dolny lewy obszar. */
  header#app-header .header-user-summary {
    grid-row: 2;
    grid-column: 1 / 3;
  }

  /* Otwieranie menu jest w dolnym wierszu, bezpośrednio za dzwonkiem. */
  header#app-header .mobile-nav-toggle {
    grid-row: 2;
    grid-column: 3;
    align-self: center;
  }
}

/* V3.01 r6 — pasek podmenu Ustawień zachowuje pozycję i wskazuje aktywną sekcję */
.settings-page.settings-hub-page,
.settings-page.settings-subpage {
    display: grid;
    width: 100%;
    grid-column: 1 / -1;
    gap: 16px;
}

.settings-hub-intro,
.settings-subpage-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
}

.settings-hub-intro h2,
.settings-subpage-header h2 {
    margin: 2px 0 5px;
}

.settings-hub-intro p,
.settings-subpage-header p {
    margin: 0;
    max-width: 720px;
    color: #666;
}

.settings-hub-intro-icon,
.settings-subpage-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 58px;
    height: 58px;
    flex: 0 0 58px;
    border-radius: 18px;
    background: #fff0f2;
    border: 1px solid #f1c5cb;
    font-size: calc(29px + var(--interface-font-delta));
}

.settings-category-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 14px;
}

.settings-category-card {
    display: grid;
    grid-template-columns: 48px minmax(0, 1fr) 22px;
    align-items: center;
    gap: 13px;
    min-height: 138px;
    color: inherit;
    text-decoration: none;
    transition: transform .16s ease, border-color .16s ease, box-shadow .16s ease;
}

.settings-category-card:hover,
.settings-category-card:focus-visible {
    transform: translateY(-2px);
    border-color: #df7b88;
    box-shadow: 0 12px 30px rgba(84, 18, 27, .12);
}

.settings-category-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 48px;
    height: 48px;
    border-radius: 15px;
    background: #f7f7f8;
    border: 1px solid #dedee2;
    font-size: calc(23px + var(--interface-font-delta));
}

.settings-category-copy {
    display: grid;
    gap: 4px;
    min-width: 0;
}

.settings-category-copy strong {
    font-size: calc(17px + var(--interface-font-delta));
    line-height: 1.15;
}

.settings-category-copy small {
    color: #64646b;
    line-height: 1.35;
}

.settings-category-copy em {
    margin-top: 4px;
    color: #8a2634;
    font-size: calc(11px + var(--interface-font-delta));
    font-style: normal;
    font-weight: 700;
    line-height: 1.3;
}

.settings-category-card > b {
    color: #bd0018;
    font-size: calc(30px + var(--interface-font-delta));
    font-weight: 400;
}

.settings-back-link {
    display: inline-flex;
    align-items: center;
    width: max-content;
    margin-bottom: 14px;
    color: #a90016;
    text-decoration: none;
    font-weight: 800;
}

.settings-subpage-header {
    display: block;
}

.settings-subpage-heading {
    display: flex;
    align-items: center;
    gap: 16px;
}

.settings-section-tabs {
    display: grid;
    grid-template-columns: repeat(6, minmax(0, 1fr));
    gap: 7px;
    padding: 7px;
    border: 1px solid #dedee2;
    border-radius: 14px;
    background: #ededf0;
}

.settings-section-tab {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 7px;
    min-width: 0;
    min-height: 46px;
    padding: 8px 7px;
    border: 1px solid transparent;
    border-radius: 10px;
    color: #3f3f45;
    text-align: center;
    text-decoration: none;
    line-height: 1.15;
}

.settings-section-tab span {
    flex: 0 0 auto;
    font-size: calc(17px + var(--interface-font-delta));
}

.settings-section-tab strong {
    overflow: hidden;
    font-size: calc(10.5px + var(--interface-font-delta));
    text-overflow: ellipsis;
}

.settings-section-tab:hover,
.settings-section-tab:focus-visible {
    background: #fff;
    border-color: #cccdd1;
}

.settings-section-tab.active {
    background: #fff;
    border-color: #d64e60;
    color: #a90016;
    box-shadow: 0 4px 12px rgba(98, 17, 28, .1);
}

.settings-section-tab.active::after {
    content: "";
    position: absolute;
    right: 12px;
    bottom: 3px;
    left: 12px;
    height: 3px;
    border-radius: 999px;
    background: currentColor;
}

.settings-subpage-content {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    align-items: start;
    gap: 16px;
}

.settings-subpage-content > .card,
.settings-subpage-content > section.card {
    min-width: 0;
    margin: 0;
}

.settings-subpage-content > :where(.app-diagnostics-card, .offline-settings-card) {
    grid-column: 1 / -1;
}

html[data-theme="dark"] .settings-hub-intro p,
html[data-theme="dark"] .settings-subpage-header p,
html[data-theme="dark"] .settings-category-copy small {
    color: #b8b8bf;
}

html[data-theme="dark"] .settings-hub-intro-icon,
html[data-theme="dark"] .settings-subpage-icon {
    background: #3a1e23;
    border-color: #74404a;
}

html[data-theme="dark"] .settings-category-icon {
    background: #252529;
    border-color: #515159;
}

html[data-theme="dark"] .settings-category-copy em,
html[data-theme="dark"] .settings-back-link {
    color: #ef8996;
}

html[data-theme="dark"] .settings-category-card > b {
    color: #f06b7c;
}

html[data-theme="dark"] .settings-section-tabs {
    background: #202024;
    border-color: #494950;
}

html[data-theme="dark"] .settings-section-tab {
    color: #d6d6da;
}

html[data-theme="dark"] .settings-section-tab:hover,
html[data-theme="dark"] .settings-section-tab:focus-visible,
html[data-theme="dark"] .settings-section-tab.active {
    background: #343439;
    border-color: #8b4b55;
    color: #ffabb5;
}

@media (max-width: 1100px) {
    .settings-category-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .settings-section-tabs {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }
}

@media (max-width: 760px) {
    .settings-page.settings-hub-page,
    .settings-page.settings-subpage {
        display: grid;
        gap: 10px;
    }

    .settings-hub-intro,
    .settings-subpage-header {
        padding: 13px;
        border-radius: 10px;
    }

    .settings-hub-intro {
        align-items: flex-start;
    }

    .settings-hub-intro-icon,
    .settings-subpage-icon {
        width: 42px;
        height: 42px;
        flex-basis: 42px;
        border-radius: 13px;
        font-size: calc(21px + var(--interface-font-delta));
    }

    .settings-category-grid {
        grid-template-columns: 1fr;
        gap: 8px;
    }

    .settings-category-card {
        grid-template-columns: 40px minmax(0, 1fr) 18px;
        min-height: 0;
        gap: 10px;
        padding: 11px 12px;
        border-radius: 10px;
    }

    .settings-category-card:hover,
    .settings-category-card:focus-visible {
        transform: none;
    }

    .settings-category-icon {
        width: 40px;
        height: 40px;
        border-radius: 12px;
        font-size: calc(20px + var(--interface-font-delta));
    }

    .settings-category-copy {
        gap: 2px;
    }

    .settings-category-copy strong {
        font-size: calc(14px + var(--interface-font-delta));
    }

    .settings-category-copy small {
        font-size: calc(10.5px + var(--interface-font-delta));
    }

    .settings-category-copy em {
        margin-top: 2px;
        font-size: calc(9.5px + var(--interface-font-delta));
    }

    .settings-category-card > b {
        font-size: calc(24px + var(--interface-font-delta));
    }

    .settings-back-link {
        margin-bottom: 9px;
        font-size: calc(11.5px + var(--interface-font-delta));
    }

    .settings-subpage-heading {
        gap: 10px;
    }

    .settings-subpage-heading h2 {
        margin-bottom: 2px;
    }

    .settings-section-tabs {
        display: flex;
        gap: 6px;
        overflow-x: auto;
        padding: 6px;
        border-radius: 11px;
        scrollbar-width: none;
        scroll-snap-type: x proximity;
    }

    .settings-section-tabs::-webkit-scrollbar {
        display: none;
    }

    .settings-section-tab {
        flex: 0 0 142px;
        min-height: 40px;
        padding: 7px 8px;
        scroll-snap-align: start;
    }

    .settings-section-tab strong {
        white-space: normal;
        font-size: calc(9.5px + var(--interface-font-delta));
    }

    .settings-subpage-content {
        grid-template-columns: 1fr;
        gap: 10px;
    }

    .settings-subpage-content > .card,
    .settings-subpage-content > section.card {
        padding: 13px;
        border-radius: 9px;
    }

    .settings-subpage-content > :where(.app-diagnostics-card, .offline-settings-card) {
        grid-column: auto;
    }
}


/* V3.01 r7 — przycisk menu mobilnego bliżej prawej krawędzi */
@media (max-width: 760px) {
  header#app-header .mobile-nav-toggle {
    justify-self: end;
    margin: 0;
  }
}


/* =========================================================
   V3.01 r8 — uporządkowany Widok roczny w Statystykach
   ========================================================= */
.annual-overview-page {
  display: grid;
  gap: 14px;
  padding: 18px;
}

.annual-overview-page .stats-page-heading {
  margin-bottom: 0;
}

.annual-overview-page .stats-page-heading p {
  margin: 5px 0 0;
  color: #626b75;
  font-size: calc(14px + var(--interface-font-delta));
  line-height: 1.4;
}

.annual-overview-page .stats-tabs {
  margin-bottom: 0;
}

.annual-year-navigation {
  width: 100%;
  margin-bottom: 0;
}

.annual-summary-grid {
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
  margin: 0;
}

.annual-summary-grid .annual-summary-card {
  min-height: 78px;
  display: grid;
  grid-template-columns: 40px minmax(0, 1fr);
  align-items: center;
  gap: 11px;
  padding: 12px 14px;
  border: 1px solid #dfe3e8;
  border-radius: 12px;
  background: #f8f9fb;
  box-shadow: none;
}

.annual-summary-grid .annual-summary-icon {
  width: 40px;
  height: 40px;
  display: grid;
  place-items: center;
  border-radius: 10px;
  background: #eceff3;
  color: #4c5661;
  font-size: calc(14px + var(--interface-font-delta));
  font-weight: 900;
  font-variant-numeric: tabular-nums;
}

.annual-summary-card.leave .annual-summary-icon {
  background: #e2f1e5;
  color: #2d733a;
}

.annual-summary-card.delegation .annual-summary-icon {
  background: #eee8fa;
  color: #6844a8;
}

.annual-summary-card.months .annual-summary-icon {
  background: #e8eef7;
  color: #385d8b;
}

.annual-summary-grid .annual-summary-card span,
.annual-summary-grid .annual-summary-card strong,
.annual-summary-grid .annual-summary-card small {
  display: block;
}

.annual-summary-grid .annual-summary-card > div > span {
  margin-bottom: 2px;
  color: #5e6873;
  font-size: calc(12px + var(--interface-font-delta));
  font-weight: 800;
  line-height: 1.2;
}

.annual-summary-grid .annual-summary-card strong {
  margin: 0;
  color: #252b31;
  font-size: calc(25px + var(--interface-font-delta));
  line-height: 1.05;
  font-variant-numeric: tabular-nums;
}

.annual-summary-grid .annual-summary-card small {
  margin-top: 3px;
  color: #747d87;
  font-size: calc(11px + var(--interface-font-delta));
  line-height: 1.2;
}

.annual-calendar-section {
  display: grid;
  gap: 11px;
  padding-top: 2px;
}

.annual-section-heading {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 18px;
  padding: 0 2px;
}

.annual-section-heading h3 {
  margin: 2px 0 0;
  color: #242a30;
  font-size: calc(21px + var(--interface-font-delta));
  line-height: 1.15;
}

.annual-section-heading p {
  max-width: 520px;
  margin: 0;
  color: #68727c;
  font-size: calc(12px + var(--interface-font-delta));
  line-height: 1.4;
  text-align: right;
}

.annual-legend {
  align-items: center;
  gap: 7px 12px;
  margin: 0;
  padding: 9px 11px;
  border-color: #dfe3e8;
  border-radius: 11px;
  background: #fafbfc;
}

.annual-legend > strong {
  margin-right: 2px;
  color: #343b43;
  font-size: calc(12px + var(--interface-font-delta));
}

.annual-legend span {
  gap: 6px;
  color: #525c66;
  font-size: calc(12px + var(--interface-font-delta));
  line-height: 1.2;
  white-space: nowrap;
}

.annual-legend i {
  width: 13px;
  height: 13px;
  border: 1px solid rgba(0, 0, 0, .08);
  border-radius: 4px;
  flex: 0 0 auto;
}

.annual-legend i.free {
  background: #e5edf7;
  border-color: #a9bfd7;
}

.annual-months-grid {
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 11px;
}

.annual-month-card {
  padding: 11px;
  border-color: #dfe3e8;
  border-radius: 12px;
  box-shadow: 0 2px 7px rgba(25, 32, 40, .07);
  transition: border-color .15s ease, box-shadow .15s ease, transform .15s ease;
}

.annual-month-card:hover {
  border-color: #c5cbd2;
  box-shadow: 0 5px 14px rgba(25, 32, 40, .11);
  transform: translateY(-1px);
}

.annual-month-card.is-current-month {
  border-color: #c90016;
  box-shadow: 0 0 0 1px rgba(201, 0, 22, .08), 0 4px 12px rgba(25, 32, 40, .09);
}

.annual-month-heading a {
  align-items: flex-start;
  margin-bottom: 9px;
}

.annual-month-title,
.annual-month-title strong,
.annual-month-title small {
  display: block;
}

.annual-month-title strong {
  color: #252b31;
  font-size: calc(16px + var(--interface-font-delta));
  line-height: 1.15;
}

.annual-month-title small {
  margin-top: 2px;
  color: #b00014;
  font-size: calc(9px + var(--interface-font-delta));
  font-weight: 800;
  line-height: 1.15;
}

.annual-month-totals {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  flex: 0 0 auto;
}

.annual-month-totals b {
  min-width: 34px;
  padding: 4px 6px;
  border-radius: 999px;
  font-size: calc(10px + var(--interface-font-delta));
  font-weight: 900;
  line-height: 1;
  text-align: center;
  font-variant-numeric: tabular-nums;
}

.annual-month-totals b.leave {
  background: #e4f2e6;
  color: #2f733b;
}

.annual-month-totals b.delegation {
  background: #eee8fa;
  color: #6844a8;
}

.annual-weekdays,
.annual-days {
  gap: 4px;
}

.annual-weekdays {
  margin-bottom: 4px;
  color: #6d7680;
  font-size: calc(10px + var(--interface-font-delta));
  font-weight: 800;
}

.annual-day {
  min-height: 30px;
  border-color: #e1e5e9;
  border-radius: 7px;
  background: #fafbfc;
  color: #30373e;
  font-size: calc(11px + var(--interface-font-delta));
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  transition: border-color .12s ease, box-shadow .12s ease, transform .12s ease;
}

.annual-day:hover,
.annual-day:focus-visible {
  z-index: 1;
  border-color: #9aa4ae;
  box-shadow: 0 2px 7px rgba(20, 27, 34, .14);
  transform: translateY(-1px);
  outline: none;
}

.annual-day b {
  right: 3px;
  bottom: 2px;
  font-size: calc(8px + var(--interface-font-delta));
  font-weight: 900;
  line-height: 1;
}

.annual-day.free {
  background: #eaf0f7;
  border-color: #b7c8db;
}

.annual-day.is-today {
  border-color: #c90016;
  box-shadow: inset 0 0 0 1px #c90016;
}

html[data-theme="dark"] .annual-overview-page .stats-page-heading p,
html[data-theme="dark"] .annual-section-heading p,
html[data-theme="dark"] .annual-summary-grid .annual-summary-card > div > span,
html[data-theme="dark"] .annual-summary-grid .annual-summary-card small,
html[data-theme="dark"] .annual-legend span {
  color: #aeb6bf;
}

html[data-theme="dark"] .annual-summary-grid .annual-summary-card,
html[data-theme="dark"] .annual-legend {
  background: #20252c;
  border-color: #414a55;
}

html[data-theme="dark"] .annual-summary-grid .annual-summary-card strong,
html[data-theme="dark"] .annual-section-heading h3,
html[data-theme="dark"] .annual-legend > strong,
html[data-theme="dark"] .annual-month-title strong {
  color: #eef1f4;
}

html[data-theme="dark"] .annual-summary-icon {
  background: #303842;
  color: #d9e0e7;
}

html[data-theme="dark"] .annual-summary-card.leave .annual-summary-icon {
  background: #203c28;
  color: #92d49e;
}

html[data-theme="dark"] .annual-summary-card.delegation .annual-summary-icon {
  background: #34284f;
  color: #c5a9ff;
}

html[data-theme="dark"] .annual-summary-card.months .annual-summary-icon {
  background: #24364d;
  color: #9fc3ed;
}

html[data-theme="dark"] .annual-month-card.is-current-month {
  border-color: #ff596b;
  box-shadow: 0 0 0 1px rgba(255, 89, 107, .12), 0 4px 12px rgba(0, 0, 0, .32);
}

html[data-theme="dark"] .annual-month-title small {
  color: #ff8f9b;
}

html[data-theme="dark"] .annual-month-totals b.leave {
  background: #203c28;
  color: #92d49e;
}

html[data-theme="dark"] .annual-month-totals b.delegation {
  background: #34284f;
  color: #c5a9ff;
}

html[data-theme="dark"] .annual-day.free {
  background: #263547;
  border-color: #475f79;
}

html[data-theme="dark"] .annual-day.is-today {
  border-color: #ff596b;
  box-shadow: inset 0 0 0 1px #ff596b;
}

@media (max-width: 1050px) {
  .annual-months-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 760px) {
  .annual-overview-page {
    gap: 11px;
    padding: 10px;
  }

  .annual-overview-page .stats-page-heading p {
    font-size: calc(12px + var(--interface-font-delta));
  }

  .annual-summary-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 7px;
  }

  .annual-summary-grid .annual-summary-card {
    min-height: 68px;
    grid-template-columns: 34px minmax(0, 1fr);
    gap: 8px;
    padding: 9px 10px;
    border-radius: 10px;
  }

  .annual-summary-grid .annual-summary-card:nth-child(3) {
    grid-column: 1 / -1;
  }

  .annual-summary-grid .annual-summary-icon {
    width: 34px;
    height: 34px;
    border-radius: 9px;
    font-size: calc(12px + var(--interface-font-delta));
  }

  .annual-summary-grid .annual-summary-card > div > span {
    font-size: calc(11px + var(--interface-font-delta));
  }

  .annual-summary-grid .annual-summary-card strong {
    font-size: calc(21px + var(--interface-font-delta));
  }

  .annual-summary-grid .annual-summary-card small {
    font-size: calc(10px + var(--interface-font-delta));
  }

  .annual-section-heading {
    display: block;
  }

  .annual-section-heading h3 {
    font-size: calc(18px + var(--interface-font-delta));
  }

  .annual-section-heading p {
    margin-top: 4px;
    max-width: none;
    text-align: left;
  }

  .annual-legend {
    flex-wrap: nowrap;
    overflow-x: auto;
    padding: 8px 9px 10px;
    scrollbar-width: thin;
  }

  .annual-legend > strong,
  .annual-legend span {
    flex: 0 0 auto;
  }

  .annual-months-grid {
    grid-template-columns: 1fr;
    gap: 9px;
  }

  .annual-month-card {
    padding: 10px;
  }

  .annual-month-title strong {
    font-size: calc(15px + var(--interface-font-delta));
  }

  .annual-weekdays {
    font-size: calc(10px + var(--interface-font-delta));
  }

  .annual-day {
    min-height: 36px;
    font-size: calc(12px + var(--interface-font-delta));
  }
}

@media (max-width: 420px) {
  .annual-summary-grid .annual-summary-card {
    grid-template-columns: 31px minmax(0, 1fr);
    gap: 7px;
    padding: 8px;
  }

  .annual-summary-grid .annual-summary-icon {
    width: 31px;
    height: 31px;
  }

  .annual-month-card {
    padding: 9px;
  }

  .annual-weekdays,
  .annual-days {
    gap: 3px;
  }

  .annual-day {
    min-height: 34px;
  }
}
