:root {
    color-scheme: light;
    --blue: #456995;
    --blue-dark: #2b4c76;
    --blue-pale: #dce8f4;
    --paper: #f5f5f2;
    --ink: #242c34;
}

* { box-sizing: border-box; }

body {
    margin: 0;
    padding: 24px 12px;
    color: var(--ink);
    background: #c9d3e2 url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAQAAAAECAYAAACp8Z5+AAAAIklEQVQIW2NkQAKrVq36zwjjgzhhYWGMYAEYB8RmROaABADeOQ8CXl/xfgAAAABJRU5ErkJggg==");
    font-family: "Times New Roman", Times, serif;
}

.container {
    width: min(100%, 1020px);
    margin: 0 auto;
    overflow: hidden;
    background: #e8e8e8;
    border: 2px solid var(--blue);
    box-shadow: 3px 3px 12px #0006;
}

.top-header {
    padding: 12px 16px;
    color: #fff;
    background: linear-gradient(#a9c4e2, var(--blue));
    border-bottom: 2px solid var(--blue-dark);
    text-align: center;
    text-shadow: 1px 1px 2px #000;
    font-size: 24px;
    letter-spacing: 1px;
}

.banner-section {
    position: relative;
    height: 150px;
    background-color: #65798a;
    background-image: linear-gradient(#0005, #0005), repeating-linear-gradient(45deg, transparent, transparent 15px, #ffffff0d 15px, #ffffff0d 30px);
    border-bottom: 1px solid #111;
}

.mpk-logo {
    position: absolute;
    top: 14px;
    left: 20px;
    width: 100px;
    height: 116px;
    padding-top: 5px;
    background: #f4f4f4;
    border: 3px solid #287a38;
    border-radius: 8px;
    box-shadow: 2px 2px 6px #0009;
    text-align: center;
}

.logo-top { margin: 0 10px 5px; color: #287a38; border-bottom: 2px solid #287a38; font: bold 16px Arial, sans-serif; }
.logo-crest { width: 50px; height: 55px; margin: 0 auto; background: url("herb.png") center / contain no-repeat; }
.logo-bottom { margin-top: 5px; color: #111; font: bold 11px Arial, sans-serif; }

.alert-bar {
    padding: 6px 12px;
    color: #4b2f00;
    background: #ffde00;
    border-bottom: 1px solid var(--blue);
    font: bold 12px Arial, sans-serif;
    text-align: center;
}

.navigation {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 7px;
    padding: 9px 12px;
    background: linear-gradient(#b4d0eb, #5c81b5);
    border-bottom: 2px solid #3a5b8c;
}

.nav-btn {
    display: inline-block;
    padding: 6px 12px;
    color: #111;
    background: linear-gradient(#fff, #c4d9ef);
    border: 1px solid var(--blue);
    border-radius: 8px;
    box-shadow: inset 1px 1px 0 #fff;
    font: bold 12px Tahoma, Arial, sans-serif;
    text-align: center;
    text-decoration: none;
    cursor: pointer;
}

.nav-btn:hover, .nav-btn:focus-visible { background: linear-gradient(#e4f0fa, #a2c2e6); text-decoration: underline; }
.nav-btn.active { color: #fff; background: linear-gradient(#8bb5e0, var(--blue)); border-color: var(--blue-dark); }

.layout { display: flex; min-height: 510px; }

.left-panel {
    flex: 0 0 235px;
    padding: 18px 15px;
    background: #dfdfdf;
    border-right: 1px solid #aaa;
    font: 13px/1.55 Tahoma, Arial, sans-serif;
}

.left-panel h3 { margin: 0 0 10px; padding-bottom: 5px; border-bottom: 1px dashed #888; font-size: 16px; }
.info-box { margin-bottom: 16px; padding: 12px; background: #fff; border: 1px solid #ccc; text-align: center; }
.side-note { padding: 12px; background: var(--blue-pale); border: 1px solid #b3c5d9; }
.side-note p { margin: 0 0 10px; }

.content { flex: 1; min-width: 0; padding: 24px 30px; background: #ededed; }
.content-title { margin: 0 0 18px; padding-bottom: 10px; border-bottom: 2px solid #ccc; color: #333; font-size: 25px; }
.lead { font-size: 17px; line-height: 1.6; }
.article-text { font-size: 15px; line-height: 1.65; }
.hero-img { display: block; width: 100%; max-height: 290px; margin: 0 0 18px; object-fit: cover; border: 2px solid #999; background: #555; }

.service-grid, .detail-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; margin-top: 20px; }
.service-card, .detail-card { padding: 16px; background: #fff; border: 1px solid #b7c2ce; box-shadow: 1px 2px 4px #00000012; }
.service-card h3, .detail-card h3 { margin: 0 0 8px; color: var(--blue-dark); font-size: 18px; }
.service-card p, .detail-card p { margin: 0 0 12px; line-height: 1.5; }
.service-card a, .text-link { color: #003e84; font-weight: bold; }
.section-heading { margin: 26px 0 10px; color: var(--blue-dark); font-size: 19px; }

.data-table { width: 100%; margin: 16px 0; border-collapse: collapse; background: #fff; font: 14px Tahoma, Arial, sans-serif; }
.data-table th { padding: 10px; color: #fff; background: var(--blue); border: 1px solid var(--blue-dark); text-align: left; }
.data-table td { padding: 10px; border: 1px solid #c7c7c7; }
.data-table tr:nth-child(even) td { background: #f7f7f7; }
.notice { margin: 16px 0; padding: 12px 14px; background: #fff8d9; border: 1px solid #d9c36d; line-height: 1.5; }
.empty-state { padding: 18px; background: #fff; border: 1px dashed #9aa8b7; text-align: center; line-height: 1.55; }
.announcement-card { padding: 18px; background: #fff; border: 1px solid #b7c2ce; border-left: 5px solid var(--blue); box-shadow: 1px 2px 4px #00000012; }
.announcement-card summary { display: block; cursor: pointer; list-style: none; }
.announcement-card summary::-webkit-details-marker { display: none; }
.announcement-date { display: block; margin: 0; color: #555; font: 12px Tahoma, Arial, sans-serif; }
.announcement-image { display: block; width: 100%; height: 190px; margin: 12px 0; object-fit: cover; border: 1px solid #aaa; transition: height 180ms ease; }
.announcement-card[open] .announcement-image { height: 360px; object-fit: contain; background: #e7e7e7; }
.announcement-title { display: block; margin: 4px 0 8px; color: var(--blue-dark); font-size: 20px; font-weight: bold; }
.announcement-teaser, .announcement-expand { display: block; line-height: 1.5; }
.announcement-expand { margin-top: 8px; color: #003e84; font: bold 12px Tahoma, Arial, sans-serif; text-decoration: underline; }
.announcement-card[open] .announcement-expand { font-size: 0; }
.announcement-card[open] .announcement-expand::after { content: "Zwiń ogłoszenie"; font-size: 12px; }
.announcement-details { margin-top: 14px; padding-top: 12px; border-top: 1px dashed #b7c2ce; line-height: 1.6; }
.announcement-details p:last-child { margin-bottom: 0; }
.announcement-body { white-space: pre-wrap; }
.announcement-meta { color: #555; font: 12px Tahoma, Arial, sans-serif; }
.ticket-offices { margin: 14px 0; border: 1px solid #b7c2ce; background: #f5f7fa; }
.ticket-offices summary { padding: 9px 11px; color: var(--blue-dark); font: bold 13px Tahoma, Arial, sans-serif; cursor: pointer; }
.ticket-offices ul { margin: 0; padding: 0 28px 12px; font: 13px/1.55 Arial, sans-serif; }
.driver-toolbar, .driver-subnav, .driver-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.driver-toolbar { justify-content: flex-end; margin: 0 0 14px; }
.driver-subnav { margin: 0 0 18px; padding: 10px; background: var(--blue-pale); border: 1px solid #b3c5d9; }
.driver-subnav a { color: #123b68; font: bold 12px Tahoma, Arial, sans-serif; }
.driver-section { margin: 18px 0; padding: 18px; background: #fff; border: 1px solid #b7c2ce; box-shadow: 1px 2px 4px #00000012; scroll-margin-top: 12px; }
.driver-section h2 { margin: 0 0 14px; padding-bottom: 8px; color: var(--blue-dark); border-bottom: 1px solid #ccd4dc; font-size: 21px; }
.driver-section h3 { color: var(--blue-dark); }
.driver-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; }
.driver-card { min-width: 0; padding: 14px; background: #f5f8fb; border: 1px solid #d3dce5; }
.driver-card h3 { margin: 0 0 8px; font-size: 17px; }
.driver-card p { line-height: 1.5; }
.driver-calendar-layout { display: grid; grid-template-columns: minmax(250px, .9fr) minmax(300px, 1.1fr); gap: 16px; align-items: start; }
.calendar-controls { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-bottom: 10px; }
.calendar-controls h3 { margin: 0; text-align: center; }
.calendar-grid { display: grid; grid-template-columns: repeat(7, minmax(28px, 1fr)); gap: 4px; }
.calendar-weekday { padding: 5px 2px; color: #33485e; font: bold 11px Tahoma, Arial, sans-serif; text-align: center; }
.calendar-day { min-height: 44px; padding: 4px; background: #f6f6f6; border: 1px solid #c7cfd7; font: bold 13px Tahoma, Arial, sans-serif; cursor: pointer; }
.calendar-day.empty { visibility: hidden; }
.calendar-day.service { background: #dcecfb; border-color: #7296b7; }
.calendar-day.off { background: #e9e9e9; color: #555; }
.calendar-day.leave { background: #fff2c9; border-color: #d2ae45; }
.calendar-day.duty { background: #eadff5; border-color: #9675b0; }
.calendar-day.selected { outline: 3px solid #1b5d99; outline-offset: 1px; }
.calendar-legend { display: flex; flex-wrap: wrap; gap: 8px 14px; margin-top: 12px; font: 12px Tahoma, Arial, sans-serif; }
.calendar-legend span::before { display: inline-block; width: 11px; height: 11px; margin-right: 5px; content: ""; vertical-align: -1px; border: 1px solid #8b98a6; background: #dcecfb; }
.calendar-legend .legend-off::before { background: #e9e9e9; }
.calendar-legend .legend-leave::before { background: #fff2c9; }
.calendar-legend .legend-duty::before { background: #eadff5; }
.service-detail { padding: 14px; background: #f5f8fb; border: 1px solid #c7d3df; line-height: 1.55; }
.service-detail dl { display: grid; grid-template-columns: minmax(115px, .7fr) 1fr; gap: 6px 12px; margin: 10px 0; }
.service-detail dt { font-weight: bold; }
.service-detail dd { margin: 0; }
.driver-table { width: 100%; border-collapse: collapse; background: #fff; font: 13px Tahoma, Arial, sans-serif; }
.driver-table th, .driver-table td { padding: 9px; border: 1px solid #c8d0d8; text-align: left; vertical-align: top; }
.driver-table th { color: #fff; background: var(--blue); }
.driver-form { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.driver-form label { display: block; font: bold 13px Tahoma, Arial, sans-serif; }
.driver-form input, .driver-form select, .driver-form textarea { display: block; width: 100%; min-height: 40px; margin-top: 5px; padding: 8px; border: 1px solid #8292a3; font: 15px Arial, sans-serif; }
.driver-form input[type="checkbox"] { display: inline-block; width: auto; min-height: 0; margin: 0 6px 0 0; padding: 0; }
.driver-form textarea { min-height: 90px; resize: vertical; }
.driver-form .full-width { grid-column: 1 / -1; }
.driver-status { min-height: 1.5em; margin: 10px 0 0; color: #214f24; font-weight: bold; }
.driver-status.error { color: #9c1c1c; }
.driver-photo-preview { display: block; max-width: min(100%, 340px); max-height: 220px; margin-top: 10px; border: 1px solid #aaa; }
.driver-notice { padding: 11px 13px; background: #fff8d9; border: 1px solid #d9c36d; line-height: 1.5; }
.driver-login { max-width: 520px; }
.application-grid { display: grid; grid-template-columns: minmax(0, 1fr); gap: 16px; margin-top: 18px; }
.application-step[hidden] { display: none !important; }
.application-step h2 { margin: 0 0 14px; color: var(--blue-dark); font-size: 20px; }
.application-choices { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; }
.application-choice { display: grid; gap: 7px; min-height: 88px; padding: 15px; color: var(--ink); background: #fff; border: 2px solid #9aafc3; text-align: left; cursor: pointer; }
.application-choice:hover, .application-choice:focus-visible { background: #eef5fb; border-color: var(--blue); }
.application-choice strong { color: var(--blue-dark); font-size: 16px; }
.application-choice span { font-size: 13px; }
.application-form { align-content: start; }
.application-form h2 { margin: 0 0 4px; color: var(--blue-dark); font-size: 20px; }
.application-consent { font-weight: normal !important; line-height: 1.5; }
.application-consent input { display: inline-block; width: auto; min-height: 0; margin-right: 7px; vertical-align: middle; }
.application-trap { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; }
.application-actions { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 10px; margin-top: 16px; }
.application-summary { display: grid; grid-template-columns: minmax(150px, .35fr) minmax(0, 1fr); gap: 8px 14px; margin: 0; }
.application-summary dt { font-weight: bold; }
.application-summary dd { min-width: 0; margin: 0; white-space: pre-wrap; overflow-wrap: anywhere; }
.driver-login input:disabled { background: #e7e7e7; color: #555; }
.contrast-toggle { background: #111; color: #fff; border: 2px solid #111; }
.large-text-toggle { background: #fff; color: #111; border: 2px solid #111; }
.high-contrast { --blue: #000; --blue-dark: #000; --blue-pale: #111; --ink: #fff; color: #fff; background: #000 !important; }
.high-contrast .container, .high-contrast .content, .high-contrast .left-panel, .high-contrast .driver-section, .high-contrast .driver-card, .high-contrast .service-detail, .high-contrast .driver-subnav { color: #fff; background: #111; border-color: #fff; }
.high-contrast .driver-section h2, .high-contrast .driver-card h3, .high-contrast .content-title { color: #ffeb00; }
.high-contrast a { color: #ffeb00; }
.high-contrast .calendar-day, .high-contrast .planner-form, .high-contrast .planner-results { color: #fff; background: #111; border-color: #fff; }
.high-contrast .calendar-day.service { background: #00366b; }
.high-contrast .calendar-day.leave { background: #514000; }
.high-contrast .calendar-day.duty { background: #321050; }
.high-contrast .calendar-day.off { background: #333; }
.high-contrast .driver-table td { color: #fff; background: #111; border-color: #fff; }
.high-contrast .driver-table th { color: #000; background: #ffeb00; border-color: #fff; }
.large-text { font-size: 1.15rem; }
body.large-text .driver-section { font-size: 1.15em; }
body.large-text .driver-table, body.large-text .calendar-weekday, body.large-text .calendar-day { font-size: 1.1em; }
button:disabled { cursor: not-allowed; opacity: .6; }
:focus-visible { outline: 3px solid #e49400; outline-offset: 2px; }

.bottom-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
    padding: 12px 18px;
    background: linear-gradient(#a9c4e2, var(--blue));
    border-top: 2px solid var(--blue-dark);
}

.copyright { color: #fff; font: 12px/1.5 Tahoma, Arial, sans-serif; text-shadow: 1px 1px 1px #000; }
.badges-container { display: flex; flex-wrap: wrap; gap: 5px; justify-content: flex-end; }
.badges-container img { display: block; width: 88px; height: 31px; border: 1px solid #fff; image-rendering: auto; }

.contact-dialog {
    width: min(92vw, 440px);
    padding: 0;
    color: var(--ink);
    background: #f4f4f2;
    border: 2px solid var(--blue-dark);
    box-shadow: 0 12px 45px #0008;
}
.contact-dialog::backdrop { background: #101b2acc; }
.driver-locked { overflow: hidden; }
.driver-locked > .container { display: none; }
.driver-login-dialog { width: min(460px, calc(100% - 32px)); }
.driver-login-dialog .driver-login { display: grid; gap: 14px; }
.driver-login-dialog .driver-login label { display: grid; gap: 6px; }
.driver-login-dialog .driver-login input { box-sizing: border-box; width: 100%; padding: 9px; }
.driver-login-dialog .driver-status { min-height: 1.4em; }
.dialog-header { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 12px 16px; color: #fff; background: linear-gradient(#a9c4e2, var(--blue)); }
.dialog-header h2 { margin: 0; font-size: 21px; }
.dialog-close { width: 32px; height: 32px; color: #fff; background: #29476c; border: 1px solid #fff; font-size: 22px; cursor: pointer; }
.dialog-content { padding: 18px; font: 14px/1.6 Arial, sans-serif; }
.dialog-content p { margin: 0 0 10px; }
.dialog-content a { color: #003e84; font-weight: bold; }
.dialog-actions { display: flex; justify-content: flex-end; gap: 8px; margin-top: 15px; }
.dialog-actions button { padding: 7px 14px; border: 1px solid var(--blue); background: #dbe8f5; cursor: pointer; }

@media (max-width: 720px) {
    body { padding: 0; }
    .container { border-width: 0; }
    .top-header { font-size: 20px; }
    .layout { display: block; }
    .left-panel { border-right: 0; border-bottom: 1px solid #aaa; }
    .content { padding: 20px 16px; }
    .service-grid, .detail-grid { grid-template-columns: 1fr; }
    .driver-grid, .driver-calendar-layout, .driver-form, .application-choices { grid-template-columns: 1fr; }
    .application-summary { grid-template-columns: 1fr; gap: 3px; }
    .application-summary dd { margin-bottom: 9px; }
    .bottom-footer { align-items: flex-start; flex-direction: column; }
    .badges-container { justify-content: flex-start; }
}
