body {
    margin: 0;
    padding: 0;
    font-family: 'Segoe UI', system-ui, sans-serif;
    background-color: #1a1a1a;
}

#map {
    position: absolute;
    top: 0;
    bottom: 0;
    width: 100%;
}

/* Przełącznik podkładów (Esri / OSM) */
.basemap-controls {
    position: absolute;
    top: 12px;
    left: 12px;
    z-index: 2;
    width: min(220px, calc(100vw - 24px));
    padding: 10px 12px;
    background: #fff;
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.2);
}

.basemap-controls-header {
    font-size: 12px;
    font-weight: 400;
    color: #1a5276;
    margin-bottom: 8px;
}

.basemap-options {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.basemap-option {
    display: flex;
    align-items: flex-start;
    gap: 8px;
    padding: 6px 4px;
    border-radius: 6px;
    cursor: pointer;
    font-size: 12px;
    color: #222;
    line-height: 1.35;
}

.basemap-option:hover:not(.is-disabled) {
    background: #f0f6fa;
}

.basemap-option.is-disabled {
    opacity: 0.55;
    cursor: not-allowed;
}

.basemap-option input {
    margin-top: 2px;
    flex-shrink: 0;
    accent-color: #1a5276;
}

.basemap-option-label {
    flex: 1;
}

.basemap-option-text {
    display: flex;
    flex-direction: column;
    flex: 1;
    min-width: 0;
}

.basemap-option-hint {
    display: block;
    margin-top: 2px;
    font-size: 10px;
    color: #888;
    font-weight: 400;
}

.map-controls-divider {
    height: 1px;
    margin: 10px 0;
    background: #e8e8e8;
}

.dxf-view-options {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.dxf-view-option {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 6px 4px;
    border-radius: 6px;
    cursor: pointer;
    font-size: 12px;
    color: #222;
    line-height: 1.35;
}

.dxf-view-option:hover {
    background: #f0f6fa;
}

.dxf-view-option input {
    flex-shrink: 0;
    accent-color: #1a5276;
}

.dxf-view-option-label {
    flex: 1;
}

.pzt-controls {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.pzt-toggle {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 6px 4px;
    border-radius: 6px;
    cursor: pointer;
    font-size: 12px;
    color: #222;
    line-height: 1.35;
}

.pzt-toggle:hover:not(.is-disabled) {
    background: #f0f6fa;
}

.pzt-toggle.is-disabled {
    opacity: 0.55;
    cursor: not-allowed;
}

.pzt-toggle input {
    flex-shrink: 0;
    accent-color: #6c757d;
}

.pzt-toggle-label {
    flex: 1;
}

.maplibregl-ctrl-attrib {
    font-size: 11px;
    max-width: min(420px, calc(100vw - 24px));
}

.maplibregl-ctrl-attrib a {
    color: #1a5276;
}

.maplibregl-popup-content {
    border-radius: 8px;
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.28);
    padding: 14px 16px;
    min-width: 260px;
    max-width: 360px;
    font-size: 13px;
    line-height: 1.45;
}

.popup-title {
    font-weight: 400;
    font-size: 14px;
    margin: 0 0 10px;
    color: #1a1a1a;
    border-bottom: 1px solid #e8e8e8;
    padding-bottom: 6px;
}

.popup-row {
    display: grid;
    grid-template-columns: 110px 1fr;
    gap: 6px 10px;
    margin-bottom: 6px;
    align-items: start;
}

.popup-label {
    font-size: 11px;
    font-weight: 400;
    text-transform: uppercase;
    letter-spacing: 0.03em;
    color: #666;
}

.popup-value {
    font-size: 12px;
    color: #222;
    word-break: break-word;
}

.popup-note {
    font-size: 11px;
    color: #888;
    font-style: italic;
    margin-top: 10px;
    padding-top: 8px;
    border-top: 1px solid #eee;
}

.popup-action-btn {
    display: block;
    width: 100%;
    margin-top: 12px;
    padding: 8px 12px;
    border: none;
    border-radius: 6px;
    background: #1a5276;
    color: #fff;
    font-size: 13px;
    font-weight: 400;
    cursor: pointer;
    transition: background 0.15s ease;
}

.popup-action-btn:hover {
    background: #154360;
}

.popup-action-btn:focus-visible {
    outline: 2px solid #3498db;
    outline-offset: 2px;
}

/* Kontrolki mapy (prawy górny róg) */
.map-controls {
    position: absolute;
    top: 12px;
    right: 12px;
    z-index: 2;
    display: flex;
    flex-direction: column;
    gap: 8px;
    align-items: flex-end;
}

.map-tool-btn {
    padding: 8px 12px;
    border: none;
    border-radius: 6px;
    background: #fff;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.22);
    color: #1a5276;
    font-size: 12px;
    font-weight: 400;
    cursor: pointer;
    transition: background 0.15s ease, color 0.15s ease;
    white-space: nowrap;
}

.map-tool-btn:hover {
    background: #f0f6fa;
}

.map-tool-btn.is-active {
    background: #1a5276;
    color: #fff;
}

.map-tool-btn:focus-visible {
    outline: 2px solid #3498db;
    outline-offset: 2px;
}

.map-tool-btn--icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    padding: 0;
}

.map-tool-btn--icon svg {
    width: 20px;
    height: 20px;
    pointer-events: none;
}

.map-tool-btn--view {
    min-width: 44px;
    text-align: center;
}

/* Panel informacji DXF (M3B) */
.dxf-info-panel {
    position: absolute;
    top: 120px;
    left: 12px;
    bottom: 16px;
    width: min(380px, calc(100vw - 24px));
    max-height: calc(100vh - 32px);
    display: flex;
    flex-direction: column;
    background: #fff;
    border-radius: 8px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.22);
    z-index: 3;
    overflow: hidden;
}

.dxf-info-panel[hidden] {
    display: none !important;
}

.dxf-info-panel-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    flex: 0 0 auto;
    padding: 12px 14px 10px;
    border-bottom: 1px solid #e8e8e8;
}

.dxf-info-panel-title {
    margin: 0;
    font-size: 14px;
    font-weight: 400;
    color: #1a5276;
}

.dxf-info-panel-close {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 28px;
    height: 28px;
    padding: 0;
    border: none;
    border-radius: 6px;
    background: transparent;
    color: #666;
    font-size: 20px;
    line-height: 1;
    cursor: pointer;
}

.dxf-info-panel-close:hover {
    background: #f0f6fa;
    color: #1a5276;
}

.dxf-info-panel-body {
    display: flex;
    flex-direction: column;
    flex: 1 1 auto;
    min-height: 0;
    overflow: hidden;
}

.dxf-info-search {
    flex: 0 0 auto;
    padding: 10px 12px 8px;
}

.dxf-info-search-input {
    display: block;
    width: 100%;
    box-sizing: border-box;
    margin: 0;
    padding: 8px 10px;
    border: 1px solid #d5dde3;
    border-radius: 6px;
    font-size: 13px;
    color: #222;
    outline: none;
}

.dxf-info-search-input:focus {
    border-color: #3498db;
    box-shadow: 0 0 0 2px rgba(52, 152, 219, 0.2);
}

.dxf-info-list-scroll {
    flex: 1 1 auto;
    min-height: 0;
    overflow-y: auto;
    overflow-x: hidden;
    -webkit-overflow-scrolling: touch;
}

.dxf-info-list {
    display: block;
    padding: 0 6px 8px;
}

.dxf-info-list-item {
    display: block;
    width: 100%;
    padding: 9px 10px;
    border: none;
    border-radius: 6px;
    background: transparent;
    text-align: left;
    font-size: 12px;
    color: #222;
    cursor: pointer;
    transition: background 0.12s ease;
}

.dxf-info-list-item:hover,
.dxf-info-list-item:focus-visible {
    background: #f0f6fa;
    outline: none;
}

.dxf-info-list-item.is-selected {
    background: #e8f2f8;
    color: #1a5276;
}

.dxf-info-list-item-line {
    display: block;
    line-height: 1.4;
}

.dxf-info-list-item-line--primary {
    font-weight: 400;
    font-size: 13px;
}

.dxf-info-list-item-line--secondary {
    margin-top: 2px;
    color: #666;
    font-weight: 400;
}

.dxf-info-panel-message {
    flex: 0 0 auto;
    padding: 12px 14px;
    font-size: 12px;
    color: #666;
    line-height: 1.5;
}

.dxf-info-empty {
    padding: 8px 14px 12px;
}

.dxf-info-panel-message code {
    font-size: 11px;
    background: #f4f6f7;
    padding: 1px 4px;
    border-radius: 3px;
}

.dxf-info-detail {
    flex: 0 0 auto;
    max-height: 42%;
    overflow-y: auto;
    padding: 10px 12px 12px;
    border-top: 1px solid #e8e8e8;
    background: #fafbfc;
}

.dxf-info-detail-title {
    margin: 0 0 8px;
    font-size: 12px;
    font-weight: 400;
    color: #1a5276;
    text-transform: uppercase;
    letter-spacing: 0.03em;
}

.dxf-info-detail-content {
    font-size: 12px;
    line-height: 1.45;
    color: #333;
}

.dxf-info-detail-row {
    margin-bottom: 6px;
}

.dxf-info-detail-label {
    display: block;
    font-size: 10px;
    font-weight: 400;
    color: #888;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

.dxf-info-detail-value {
    display: block;
    word-break: break-word;
}

.dxf-info-layers {
    margin: 4px 0 0;
    padding-left: 18px;
    max-height: 120px;
    overflow-y: auto;
}

.dxf-info-layers li {
    margin-bottom: 2px;
}

.dxf-info-no-geometry {
    margin-top: 8px;
    padding: 8px 10px;
    font-size: 12px;
    color: #7f6000;
    background: #fef9e7;
    border-radius: 6px;
    border: 1px solid #f4d03f;
}

.dxf-info-zoom-btn {
    display: block;
    width: 100%;
    margin-top: 10px;
    padding: 8px 12px;
    border: none;
    border-radius: 6px;
    background: #1a5276;
    color: #fff;
    font-size: 13px;
    font-weight: 400;
    cursor: pointer;
}

.dxf-info-zoom-btn:hover {
    background: #154360;
}

.dxf-info-zoom-btn:focus-visible {
    outline: 2px solid #3498db;
    outline-offset: 2px;
}

.dxf-info-detail-actions {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    margin-top: 0.75rem;
}

.dxf-info-clear-btn {
    width: 100%;
    padding: 0.55rem 0.75rem;
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 6px;
    background: rgba(255, 255, 255, 0.06);
    color: #ecf0f1;
    font-size: 0.85rem;
    cursor: pointer;
    transition: background 0.15s ease;
}

.dxf-info-clear-btn:hover {
    background: rgba(255, 255, 255, 0.12);
}

.dxf-info-clear-btn:focus-visible {
    outline: 2px solid #3498db;
    outline-offset: 2px;
}

/* Panel rastrów historycznych (M4C) */
.history-raster-panel {
    position: absolute;
    left: 12px;
    bottom: 16px;
    width: min(340px, calc(100vw - 24px));
    max-height: min(45vh, 420px);
    display: flex;
    flex-direction: column;
    background: #fff;
    border-radius: 8px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.22);
    z-index: 3;
    overflow: hidden;
}

.history-raster-panel[hidden] {
    display: none !important;
}

.history-raster-panel-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    flex: 0 0 auto;
    padding: 12px 14px 10px;
    border-bottom: 1px solid #e8e8e8;
}

.history-raster-panel-title {
    margin: 0;
    font-size: 14px;
    font-weight: 400;
    color: #1a5276;
}

.history-raster-panel-close {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 28px;
    height: 28px;
    padding: 0;
    border: none;
    border-radius: 6px;
    background: transparent;
    color: #666;
    font-size: 20px;
    line-height: 1;
    cursor: pointer;
}

.history-raster-panel-close:hover {
    background: #f0f6fa;
    color: #1a5276;
}

.history-raster-panel-body {
    display: flex;
    flex-direction: column;
    flex: 1 1 auto;
    min-height: 0;
}

.history-raster-panel-message {
    flex: 0 0 auto;
    padding: 12px 14px;
    font-size: 12px;
    color: #666;
    line-height: 1.5;
}

.history-raster-panel-message code {
    font-size: 11px;
    background: #f4f6f7;
    padding: 1px 4px;
    border-radius: 3px;
}

/* Panel pomiarów (prawy dolny róg) */
.measurement-panel {
    position: absolute;
    right: 12px;
    bottom: 16px;
    width: min(280px, calc(100vw - 24px));
    background: #fff;
    border-radius: 8px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.22);
    z-index: 3;
    overflow: hidden;
}

.measurement-panel[hidden] {
    display: none !important;
}

.measurement-panel-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    padding: 10px 12px 8px;
    border-bottom: 1px solid #e8e8e8;
}

.measurement-panel-title {
    margin: 0;
    font-size: 14px;
    font-weight: 400;
    color: #1a5276;
}

.measurement-panel-close {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 28px;
    height: 28px;
    padding: 0;
    border: none;
    border-radius: 6px;
    background: transparent;
    color: #666;
    font-size: 20px;
    line-height: 1;
    cursor: pointer;
}

.measurement-panel-close:hover {
    background: #f0f6fa;
    color: #1a5276;
}

.measurement-panel-body {
    padding: 10px 12px 12px;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.measurement-modes {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.measurement-mode {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 6px 4px;
    border-radius: 6px;
    cursor: pointer;
    font-size: 12px;
    color: #222;
}

.measurement-mode:hover {
    background: #f0f6fa;
}

.measurement-mode input {
    flex-shrink: 0;
    accent-color: #1a5276;
}

.measurement-result {
    font-size: 12px;
    color: #222;
    background: #f8fafc;
    border: 1px solid #e3e8ee;
    border-radius: 6px;
    padding: 8px 10px;
    line-height: 1.35;
    min-height: 40px;
    white-space: pre-line;
}

.measurement-hints {
    display: flex;
    justify-content: space-between;
    gap: 10px;
    font-size: 10px;
    color: #777;
}

.measurement-clear-btn {
    align-self: stretch;
    padding: 7px 10px;
    border: 1px solid #c8c8c8;
    border-radius: 6px;
    background: #fafafa;
    color: #333;
    font-size: 12px;
    font-weight: 400;
    cursor: pointer;
    transition: background 0.15s ease, border-color 0.15s ease;
}

.measurement-clear-btn:hover {
    background: #f0f0f0;
    border-color: #aaa;
}

.history-raster-list-scroll {
    flex: 1 1 auto;
    min-height: 0;
    overflow-y: auto;
    padding: 8px 10px;
}

.history-raster-list {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.history-raster-list-item {
    display: flex;
    flex-direction: column;
    gap: 2px;
    width: 100%;
    padding: 8px 10px;
    border: 1px solid #e8e8e8;
    border-radius: 6px;
    background: #fff;
    text-align: left;
    cursor: pointer;
    transition: background 0.15s ease, border-color 0.15s ease;
}

.history-raster-list-item:hover,
.history-raster-list-item:focus-visible {
    background: #f0f6fa;
    border-color: #aed6f1;
}

.history-raster-list-item.is-selected {
    background: #eaf4fb;
    border-color: #1a5276;
}

.history-raster-list-item-line {
    display: block;
    line-height: 1.35;
}

.history-raster-list-item-line--primary {
    font-size: 13px;
    font-weight: 400;
    color: #1a5276;
}

.history-raster-list-item-line--secondary {
    font-size: 11px;
    color: #666;
}

.history-raster-controls {
    flex: 0 0 auto;
    display: flex;
    flex-direction: column;
    gap: 8px;
    padding: 10px 12px 12px;
    border-top: 1px solid #e8e8e8;
    background: #fafbfc;
}

.history-raster-year-row {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.history-raster-year-label {
    font-size: 11px;
    color: #555;
}

.history-raster-select {
    height: 34px;
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.055);
    color: #eef4f9;
}

.history-raster-field-label {
    font-size: 11px;
    color: var(--muted);
    font-weight: 400;
}

/* Map swipe compare (Geoportal-style) */
#map.map-swipe-active {
    z-index: 0;
}

.map-compare {
    z-index: 8;
}

.map-compare.is-inactive {
    visibility: hidden;
    pointer-events: none;
}

.map-compare.is-active {
    visibility: visible;
    pointer-events: none;
}

.map-swipe {
    position: absolute;
    top: var(--topbar-height, 76px);
    bottom: 0;
    z-index: 35;
    width: 0;
    transform: translateX(-50%);
    pointer-events: none;
}

.map-swipe.is-active {
    pointer-events: auto;
}

.map-swipe-line {
    position: absolute;
    top: 0;
    bottom: 0;
    left: 0;
    width: 3px;
    margin-left: -1.5px;
    background: #ffffff;
    box-shadow: 0 0 10px rgba(0, 0, 0, 0.45);
    cursor: ew-resize;
    pointer-events: auto;
}

.map-swipe-handle {
    position: absolute;
    top: 50%;
    left: 0;
    transform: translate(-50%, -50%);
    width: 46px;
    height: 46px;
    border: 2px solid #ffffff;
    border-radius: 50%;
    background: rgba(12, 24, 38, 0.94);
    color: #ffffff;
    font-size: 20px;
    line-height: 1;
    cursor: ew-resize;
    pointer-events: auto;
    box-shadow: 0 6px 18px rgba(0, 0, 0, 0.38);
}

.history-raster-enabled-controls {
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin-top: 10px;
    padding-top: 10px;
    border-top: 1px solid #e8e8e8;
}

.history-raster-enabled-controls[hidden] {
    display: none !important;
}

.history-raster-badge {
    position: absolute;
    top: calc(var(--topbar-height, 76px) + 14px);
    left: 50%;
    transform: translate(-50%, -12px);
    z-index: 12;
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 14px;
    border-radius: 8px;
    background: rgba(8, 18, 29, 0.88);
    border: 1px solid rgba(255, 255, 255, 0.12);
    color: #e8f0f7;
    font-size: 12px;
    font-weight: 400;
    pointer-events: none;
    opacity: 0;
    transition: opacity 0.25s ease, transform 0.25s ease;
}

.history-raster-badge.is-visible {
    opacity: 1;
    transform: translate(-50%, 0);
}

.history-raster-badge-year {
    color: #8fbeff;
}

/* Basemap preview thumbnails */
.basemap-option:before {
    display: none !important;
}

.basemap-option-thumb {
    display: block;
    width: 100%;
    height: 58px;
    border-radius: 8px;
    border: 1px solid rgba(255, 255, 255, 0.14);
    background-color: rgba(255, 255, 255, 0.06);
    background-size: cover;
    background-position: center;
    box-shadow: inset 0 0 0 1px rgba(0, 0, 0, 0.14);
}

.basemap-option:has(input:checked) .basemap-option-thumb {
    border-color: #3f8cff;
    box-shadow: 0 0 0 2px rgba(47, 128, 237, 0.46);
}

.dxf-info-list-item:after {
    display: none !important;
}

.history-raster-toggle {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 12px;
    font-weight: 400;
    color: #333;
    cursor: pointer;
}

.history-raster-toggle input {
    accent-color: #1a5276;
}

.history-raster-opacity-label {
    font-size: 11px;
    color: #555;
}

.history-raster-opacity {
    width: 100%;
    accent-color: #1a5276;
}

.history-raster-zoom-btn {
    width: 100%;
    padding: 8px 12px;
    border: none;
    border-radius: 6px;
    background: #1a5276;
    color: #fff;
    font-size: 12px;
    font-weight: 400;
    cursor: pointer;
}

.history-raster-zoom-btn:hover {
    background: #154360;
}

.history-raster-zoom-btn:focus-visible {
    outline: 2px solid #3498db;
    outline-offset: 2px;
}


/* V2 dark Tasklist Pro shell */
:root{--topbar-height:76px;--rail-width:0px;--sidebar-width:320px;--map-left-offset:var(--sidebar-width);--bg:#07111c;--panel:rgba(10,24,38,.96);--panel2:rgba(8,18,30,.98);--line:rgba(160,180,205,.17);--text:#eef5fb;--muted:#9cadbd;--blue:#2f80ed;--shadow:0 18px 42px rgba(0,0,0,.36)}
*{box-sizing:border-box}html,body{width:100%;height:100%;overflow:hidden}body.v2-shell{margin:0;background:#08131f;color:var(--text);font-family:"Segoe UI",system-ui,sans-serif;-webkit-font-smoothing:antialiased}button,input,select,textarea{font:inherit}button{color:inherit}.map-stage,#map,.map-compare,.map-vector-overlay{position:absolute;inset:0;width:100%;height:100%}#map{top:0;bottom:0}.app-topbar{position:absolute;inset:0 0 auto 0;z-index:30;height:var(--topbar-height);display:grid;grid-template-columns:minmax(260px,380px) minmax(260px,560px) minmax(420px,1fr) auto;align-items:center;gap:22px;padding:0 18px;background:linear-gradient(180deg,rgba(8,16,25,.99),rgba(5,13,22,.95));border-bottom:1px solid rgba(255,255,255,.08);box-shadow:0 10px 30px rgba(0,0,0,.26)}.topbar-left{display:flex;align-items:center;gap:16px;min-width:0}.app-menu-btn{width:50px;height:50px;border:1px solid rgba(255,255,255,.13);border-radius:8px;background:rgba(255,255,255,.08);font-size:28px;line-height:1;cursor:pointer}.app-menu-btn:hover{background:rgba(255,255,255,.14)}.app-topbar-title{font-size:18px;font-weight: 400;color:#fff;white-space:nowrap}.app-topbar-subtitle{margin-top:4px;color:#a8b6c5;font-size:12px;font-weight: 400}.topbar-search{position:relative;height:46px}.topbar-search input{width:100%;height:100%;padding:0 46px 0 22px;border:1px solid rgba(255,255,255,.14);border-radius:8px;background:rgba(255,255,255,.05);color:#edf5fc;outline:0;font-weight: 400}.topbar-search input::placeholder{color:rgba(220,230,240,.62)}.search-icon{position:absolute;right:15px;top:8px;color:#c4d1df;font-size:24px}.map-toolbar,.map-controls{position:static;display:flex;align-items:center;justify-content:center;gap:12px;max-width:none}.map-tool-btn{display:inline-flex;align-items:center;justify-content:center;gap:8px;min-width:78px;height:58px;padding:8px;border:0;border-radius:8px;background:transparent;box-shadow:none;color:rgba(232,239,246,.78);font-size:12px;font-weight: 400;cursor:pointer;white-space:nowrap}.map-tool-btn:hover,.map-tool-btn.is-active{background:rgba(47,128,237,.18);color:#83b8ff}.topbar-actions{display:flex;gap:12px}.topbar-actions span{display:grid;place-items:center;width:48px;height:48px;border-radius:50%;background:rgba(255,255,255,.06);font-size:22px}.side-rail{position:absolute;top:var(--topbar-height);left:0;bottom:0;z-index:18;width:var(--rail-width);display:flex;flex-direction:column;align-items:center;gap:16px;padding:18px 8px;background:linear-gradient(180deg,rgba(12,25,38,.98),rgba(8,19,31,.96));border-right:1px solid var(--line)}.rail-icon{display:grid;place-items:center;width:46px;height:46px;border-radius:8px;color:#aeb9c5;font-size:22px}.rail-icon.is-active{color:#82b6ff;background:rgba(47,128,237,.26)}.duty-sidebar{position:absolute;top:var(--topbar-height);left:var(--rail-width);bottom:0;z-index:17;width:min(var(--sidebar-width),calc(100vw - var(--rail-width)));display:flex;flex-direction:column;background:linear-gradient(180deg,rgba(15,30,44,.965),rgba(9,21,34,.95));border-right:1px solid var(--line);box-shadow:var(--shadow);overflow:hidden;transition:transform .22s ease}body.sidebar-collapsed .duty-sidebar{transform:translateX(-100%)}.duty-sidebar-section{flex:0 0 auto;padding:17px 18px;border-bottom:1px solid var(--line)}.duty-sidebar-section--pzt{margin-top:auto;background:rgba(5,14,24,.45)}.duty-sidebar-section-head,.layer-switch-row{display:flex;align-items:center;justify-content:space-between;gap:14px}.duty-sidebar-section-title{margin:0;color:#d3dde8;font-size:13px;font-weight: 400;text-transform:uppercase}.layer-switch-row p{margin:5px 0 0;color:var(--muted);font-size:12px;font-weight: 400}.modern-switch{position:relative;display:inline-flex;width:52px;height:30px;cursor:pointer}.modern-switch input{position:absolute;inset:0;opacity:0}.switch-track{position:relative;width:52px;height:30px;border-radius:999px;background:rgba(126,143,162,.28);border:1px solid rgba(255,255,255,.14);transition:.16s}.switch-track:after{content:"";position:absolute;top:3px;left:3px;width:22px;height:22px;border-radius:50%;background:#dbe7f2;box-shadow:0 2px 8px rgba(0,0,0,.35);transition:.16s}.modern-switch input:checked+.switch-track{background:linear-gradient(135deg,#1f6feb,#4f9bff);border-color:rgba(133,188,255,.65)}.modern-switch input:checked+.switch-track:after{transform:translateX(22px);background:#fff}.basemap-options{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:10px;margin-top:12px}.basemap-option{position:relative;display:flex;flex-direction:column;gap:8px;min-height:94px;padding:0;color:#d6e1ed;background:transparent;border-radius:8px;overflow:hidden}.basemap-option input{position:absolute;opacity:0}.basemap-option:before{content:"";height:58px;border-radius:8px;border:1px solid rgba(255,255,255,.14);background:linear-gradient(140deg,rgba(48,91,54,.95),rgba(118,129,76,.8) 48%,rgba(35,72,91,.9));box-shadow:inset 0 0 0 1px rgba(0,0,0,.14)}.basemap-option:nth-child(2):before{background:linear-gradient(135deg,rgba(63,96,59,.88),rgba(164,143,92,.78))}.basemap-option:nth-child(3):before{background:linear-gradient(135deg,#e7ead9,#b9d4bd)}.basemap-option:has(input:checked):before{border-color:#3f8cff;box-shadow:0 0 0 2px rgba(47,128,237,.46)}.basemap-option-label{display:block;overflow:hidden;text-align:center;text-overflow:ellipsis;white-space:nowrap;color:#c8d4df;font-size:11px;font-weight: 400}.basemap-option:has(input:checked) .basemap-option-label{color:#81b6ff}.basemap-option-hint{font-size:10px;color:#8291a0}.dxf-info-panel{position:relative;inset:auto;z-index:auto;flex:1 1 auto;width:auto;max-height:none;display:flex;flex-direction:column;background:rgba(6,16,27,.38);border-radius:0;box-shadow:none;border-bottom:1px solid var(--line);overflow:hidden}.dxf-info-panel[hidden]{display:none!important}.dxf-info-panel-header{padding:16px 18px 12px;border-bottom:1px solid var(--line);display:flex;align-items:center;justify-content:space-between}.dxf-info-panel-title{margin:0;color:#d3dde8;font-size:13px;font-weight: 400;text-transform:uppercase}.dxf-info-panel-close,.history-raster-panel-close,.measurement-panel-close{width:30px;height:30px;border:0;border-radius:8px;background:transparent;color:#a9b8c8;font-size:22px;cursor:pointer}.dxf-info-panel-close:hover,.history-raster-panel-close:hover,.measurement-panel-close:hover{background:rgba(255,255,255,.08);color:white}.dxf-info-panel-body{display:flex;flex:1 1 auto;flex-direction:column;min-height:0;overflow:hidden}.dxf-info-search{padding:14px 18px 10px}.dxf-info-search-input{width:100%;height:40px;padding:0 13px;border:1px solid rgba(255,255,255,.12);border-radius:8px;background:rgba(255,255,255,.05);color:#edf5fc;outline:0;font-weight: 400}.dxf-info-list-scroll{flex:1 1 auto;min-height:130px;overflow-y:auto}.dxf-info-list{display:flex;flex-direction:column;gap:6px;padding:0 12px 14px}.dxf-info-list-item{position:relative;width:100%;padding:10px 38px 10px 38px;border:1px solid transparent;border-radius:8px;background:transparent;color:#d8e2ec;text-align:left;cursor:pointer}.dxf-info-list-item:before{content:"";position:absolute;left:14px;top:18px;width:14px;height:9px;border:2px solid rgba(210,222,234,.78);border-radius:3px}.dxf-info-list-item:after{content:"?";position:absolute;right:12px;top:12px;color:#9aaaba;font-size:20px}.dxf-info-list-item:hover,.dxf-info-list-item.is-selected{background:rgba(47,128,237,.18);border-color:rgba(94,162,255,.35)}.dxf-info-list-item-line--primary{font-size:12px;font-weight: 400;color:#fff}.dxf-info-list-item-line--secondary{margin-top:3px;font-size:11px;font-weight: 400;color:var(--muted)}.dxf-info-detail{max-height:48%;padding:14px 18px 16px;border-top:1px solid var(--line);background:rgba(4,13,22,.72);overflow-y:auto}.dxf-info-detail-title{margin:0 0 10px;color:#8fbeff;font-size:12px;font-weight: 400;text-transform:uppercase}.dxf-info-detail-content{color:#d8e1ea;font-size:12px}.dxf-info-detail-label{color:#7f90a1}.dxf-info-detail-value{color:#e9f1f8}.dxf-info-zoom-btn,.history-raster-zoom-btn{min-height:36px;border:1px solid rgba(113,173,255,.38);border-radius:8px;background:linear-gradient(135deg,#1f6feb,#2f80ed);color:white;font-weight: 400}.dxf-info-clear-btn,.measurement-clear-btn{min-height:36px;border:1px solid rgba(163,180,198,.22);border-radius:8px;background:rgba(255,255,255,.06);color:#d8e4ef;font-weight: 400}.map-quick-controls{position:absolute;top:calc(var(--topbar-height) + 32px);right:22px;z-index:16;display:flex;flex-direction:column;gap:12px;pointer-events:none}.map-quick-group{display:flex;flex-direction:column;overflow:hidden;border:1px solid rgba(255,255,255,.1);border-radius:8px;background:rgba(10,20,31,.92);box-shadow:0 10px 28px rgba(0,0,0,.28);pointer-events:auto}.map-quick-btn{display:grid;place-items:center;width:54px;height:48px;border:0;border-bottom:1px solid rgba(255,255,255,.08);background:transparent;color:#d9e3ee;font-size:20px;font-weight: 400;cursor:pointer}.map-quick-btn:last-child{border-bottom:0}.map-quick-btn:hover,.map-quick-btn[aria-pressed=true]{background:rgba(47,128,237,.2);color:#7db1ff}.history-raster-panel{position:absolute;left:calc(var(--rail-width) + var(--sidebar-width) + 18px);right:430px;bottom:18px;z-index:14;width:auto;max-height:240px;display:flex;flex-direction:column;color:var(--text);background:rgba(10,20,31,.93);border:1px solid rgba(255,255,255,.1);border-radius:8px;box-shadow:var(--shadow);overflow:hidden}.history-raster-panel[hidden],.measurement-panel[hidden]{display:none!important}.history-raster-panel-header,.measurement-panel-header{display:flex;align-items:center;justify-content:space-between;padding:14px 16px 12px;border-bottom:1px solid var(--line)}.history-raster-panel-title,.measurement-panel-title{margin:0;color:#d5dee8;font-size:13px;font-weight: 400;text-transform:uppercase}.history-raster-panel-subtitle{margin:3px 0 0;color:var(--muted);font-size:11px}.history-raster-panel-body{display:grid;grid-template-columns:minmax(180px,1fr) 220px;min-height:0}.history-raster-list-scroll{max-height:170px;padding:12px;overflow-y:auto}.history-raster-list{display:grid;grid-template-columns:repeat(auto-fit,minmax(72px,1fr));gap:8px}.history-raster-list-item{min-height:60px;padding:8px 9px;border:1px solid rgba(255,255,255,.1);border-radius:8px;background:rgba(255,255,255,.05);color:#d8e2ec}.history-raster-list-item.is-selected{background:rgba(47,128,237,.2);border-color:rgba(95,164,255,.54)}.history-raster-list-item-line--primary{color:#8fbeff;font-weight: 400}.history-raster-list-item-line--secondary{color:var(--muted);font-size:10px}.history-raster-controls{display:flex;flex-direction:column;gap:8px;padding:12px 14px;border-left:1px solid var(--line);background:rgba(4,13,22,.32)}.history-raster-toggle,.measurement-mode{display:flex;align-items:center;gap:8px;color:#d6e0ea;font-size:12px;font-weight: 400}.history-raster-select{height:34px;border:1px solid rgba(255,255,255,.12);border-radius:8px;background:rgba(255,255,255,.055);color:#eef4f9}.measurement-panel{position:absolute;right:22px;bottom:18px;z-index:15;width:360px;max-width:calc(100vw - 44px);color:var(--text);background:rgba(10,20,31,.94);border:1px solid rgba(255,255,255,.1);border-radius:8px;box-shadow:var(--shadow);overflow:hidden}.measurement-panel-body{display:flex;flex-direction:column;gap:12px;padding:14px 16px 16px}.measurement-modes{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:8px}.measurement-mode{justify-content:center;min-height:36px;border:1px solid rgba(255,255,255,.1);border-radius:8px;background:rgba(255,255,255,.05)}.measurement-result{min-height:72px;padding:11px 12px;border:1px solid rgba(255,255,255,.1);border-radius:8px;background:rgba(2,10,17,.42);color:#e9f1f8;white-space:pre-line}.history-raster-badge{top:calc(var(--topbar-height) + 14px);z-index:12;background:rgba(8,18,29,.88);border:1px solid rgba(255,255,255,.1)}.map-zoom-debug{left:calc(var(--rail-width) + var(--sidebar-width) + 14px);bottom:14px;z-index:12;background:rgba(8,18,29,.86);color:#d7e4f0}.map-runtime-status{left:calc(var(--rail-width) + var(--sidebar-width) + 14px);bottom:54px;z-index:12;background:rgba(8,18,29,.9);color:#d7e4f0}.maplibregl-popup-content{border:1px solid rgba(255,255,255,.1);border-radius:8px;background:rgba(10,20,31,.96);color:#e9f1f8;box-shadow:var(--shadow)}.popup-title{color:#fff;border-bottom-color:rgba(255,255,255,.12)}.popup-label{color:#93a4b5}.popup-value{color:#e8f0f7}@media(max-width:1040px){.app-topbar{grid-template-columns:minmax(220px,310px) 1fr auto}.topbar-search{display:none}.history-raster-panel{right:22px}}@media(max-width:820px){:root{--topbar-height:70px;--rail-width:58px;--sidebar-width:calc(100vw - 58px)}.app-topbar{grid-template-columns:minmax(190px,1fr) auto;padding:0 10px}.topbar-actions{display:none}.map-toolbar{justify-content:flex-end;gap:4px;overflow-x:auto}.map-tool-btn{min-width:50px;height:50px;font-size:10px}.history-raster-panel{left:calc(var(--rail-width) + 10px);right:10px;bottom:10px}.history-raster-panel-body{grid-template-columns:1fr}.history-raster-controls{border-left:0;border-top:1px solid var(--line)}}

/* Sidebar: menu warstw vs tryb Projekt/DXF */
.duty-sidebar-main {
    display: flex;
    flex: 1 1 auto;
    flex-direction: column;
    min-height: 0;
    overflow-x: hidden;
    overflow-y: auto;
}

.duty-sidebar-main .duty-sidebar-section--pzt {
    margin-top: auto;
}

.duty-sidebar #dxf-info-panel {
    flex: 1 1 auto;
    min-height: 0;
}

.duty-sidebar:not(.duty-sidebar--project-mode) #dxf-info-panel {
    display: none !important;
}

.duty-sidebar--project-mode .duty-sidebar-main {
    display: none;
}

.duty-sidebar--project-mode #dxf-info-panel {
    display: flex !important;
    flex: 1 1 auto;
    min-height: 0;
    border-bottom: 0;
}

.duty-sidebar-back-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    flex-shrink: 0;
    border: 1px solid rgba(255, 255, 255, 0.14);
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.06);
    color: #d8e4ef;
    font-size: 20px;
    line-height: 1;
    cursor: pointer;
}

.duty-sidebar-back-btn:hover {
    background: rgba(47, 128, 237, 0.22);
    color: #fff;
    border-color: rgba(133, 188, 255, 0.45);
}

.duty-sidebar--project-mode .dxf-info-panel-header {
    gap: 12px;
}

.duty-sidebar--project-mode .dxf-info-panel-title {
    flex: 1;
    min-width: 0;
}

.duty-sidebar--project-mode .dxf-info-list-scroll {
    flex: 1 1 auto;
    min-height: 0;
}

.duty-sidebar--project-mode .dxf-info-panel-body {
    flex: 1 1 auto;
}

/* Floating map panels (osobne okna, nie w sidebarze) */
body.v2-shell .map-floating-panel.dxf-info-panel {
    position: absolute;
    top: calc(var(--topbar-height) + 18px);
    left: calc(var(--rail-width) + var(--sidebar-width) + 18px);
    bottom: 18px;
    width: min(420px, calc(100vw - var(--rail-width) - var(--sidebar-width) - 36px));
    max-height: none;
    z-index: 16;
    flex: none;
    display: flex;
    flex-direction: column;
    background: rgba(10, 20, 31, 0.96);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 8px;
    box-shadow: 0 18px 42px rgba(0, 0, 0, 0.36);
    overflow: hidden;
}

body.sidebar-collapsed .map-floating-panel.dxf-info-panel {
    left: calc(var(--rail-width) + 18px);
    width: min(420px, calc(100vw - var(--rail-width) - 36px));
}

body.v2-shell .history-raster-panel {
    z-index: 22;
    max-height: calc(100vh - var(--topbar-height) - 36px);
}

body.v2-shell .history-raster-controls {
    overflow-y: auto;
}

body.dxf-panel-open .dxf-detail-window {
    left: calc(var(--rail-width) + var(--sidebar-width) + 18px);
    width: min(420px, calc(100vw - var(--rail-width) - var(--sidebar-width) - 36px));
    max-height: calc(100vh - var(--topbar-height) - 36px);
}

body.dxf-panel-open .history-raster-panel {
    left: calc(var(--rail-width) + var(--sidebar-width) + 450px);
}

body.dxf-panel-open.sidebar-collapsed .history-raster-panel {
    left: calc(var(--rail-width) + 450px);
}

.dxf-detail-window {
    position: absolute;
    top: calc(var(--topbar-height) + 18px);
    left: calc(var(--rail-width) + var(--sidebar-width) + 18px);
    z-index: 10020;
    width: min(390px, calc(100vw - var(--rail-width) - var(--sidebar-width) - 42px));
    max-height: calc(100vh - var(--topbar-height) - 36px);
    display: flex;
    flex-direction: column;
    color: var(--text);
    background: #0b1522;
    border: 1px solid rgba(137, 181, 224, 0.42);
    border-radius: 8px;
    box-shadow: 0 22px 60px rgba(0, 0, 0, 0.82);
    overflow: hidden;
}

.dxf-detail-window[hidden] {
    display: none !important;
}

.dxf-detail-window-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    padding: 14px 16px 12px;
    border-bottom: 1px solid var(--line);
}

.dxf-detail-window .dxf-info-detail > .dxf-info-detail-title {
    display: none;
}

.dxf-detail-window .dxf-info-detail {
    flex: 1 1 auto;
    min-height: 0;
    max-height: none;
    padding: 14px 16px 16px;
    border-top: 0;
    background: #08101a;
    overflow-y: auto;
}

.dxf-detail-window .dxf-info-zoom-btn,
.dxf-detail-window .dxf-info-clear-btn {
    width: 100%;
    margin-top: 10px;
}

.dxf-detail-window .dxf-info-clear-btn {
    margin-top: 8px;
}

body.dxf-panel-open.sidebar-collapsed .dxf-detail-window {
    left: calc(var(--rail-width) + 18px);
    width: min(420px, calc(100vw - var(--rail-width) - 36px));
}

body.sidebar-collapsed .dxf-detail-window {
    left: calc(var(--rail-width) + 18px);
    width: min(390px, calc(100vw - var(--rail-width) - 42px));
}

@media (max-width: 820px) {
    .history-raster-panel {
        max-height: calc(100vh - var(--topbar-height) - 20px);
    }

    .history-raster-panel-body {
        overflow-y: auto;
    }

    .history-raster-list-scroll {
        max-height: 120px;
    }

    .dxf-detail-window {
        top: calc(var(--topbar-height) + 10px);
        left: calc(var(--rail-width) + 10px);
        right: 10px;
        width: auto;
        max-height: min(290px, calc(100vh - var(--topbar-height) - 250px));
    }
}
.colleague-layer-switches { display:grid; grid-template-columns:repeat(3,1fr); gap:6px; margin-top:10px; }
.colleague-layer-switches label { display:flex; align-items:center; gap:5px; color:#c8d4df; font-size:11px; }

.duty-sidebar-main .duty-sidebar-section--pzt { margin-top: 0; }

.maplibregl-popup.dxf-canvas-detail-popup { z-index: 10030; }
.dxf-canvas-detail-popup .maplibregl-popup-content {
    opacity: 1;
    background: #0b1522;
    border: 1px solid rgba(137, 181, 224, 0.48);
    box-shadow: 0 18px 50px rgba(0, 0, 0, 0.86);
    backdrop-filter: none;
}
.dxf-canvas-detail-popup .maplibregl-popup-tip { border-top-color: #0b1522; border-bottom-color: #0b1522; }

/* Kompaktowy wybór podkładu */
.basemap-options.basemap-select {
    position: relative;
    display: block;
    width: min(150px, 100%);
    margin-top: 12px;
}

.basemap-current {
    display: grid;
    grid-template-columns: 38px minmax(0, 1fr) 18px;
    align-items: center;
    gap: 8px;
    width: 100%;
    min-height: 46px;
    padding: 5px 8px;
    border: 1px solid rgba(255, 255, 255, 0.16);
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.06);
    color: #d6e1ed;
    cursor: pointer;
}

.basemap-current-thumb,
.basemap-menu .basemap-option-thumb {
    width: 38px;
    height: 32px;
    border: 1px solid rgba(255, 255, 255, 0.18);
    border-radius: 6px;
    background-color: #fff;
    background-position: center;
    background-size: cover;
}

.basemap-current-label { overflow: hidden; text-align: left; text-overflow: ellipsis; white-space: nowrap; font-size: 11px; font-weight: 400; }
.basemap-current-arrow { color: #91a5b9; transition: transform 0.15s ease; }
.basemap-current[aria-expanded="true"] .basemap-current-arrow { transform: rotate(180deg); }

.basemap-menu {
    position: absolute;
    top: calc(100% + 5px);
    left: 0;
    z-index: 40;
    width: max(180px, 100%);
    max-height: 240px;
    padding: 5px;
    overflow-y: auto;
    border: 1px solid rgba(255, 255, 255, 0.14);
    border-radius: 8px;
    background: rgba(9, 21, 34, 0.98);
    box-shadow: 0 12px 30px rgba(0, 0, 0, 0.38);
}

.basemap-menu[hidden] { display: none; }
.basemap-menu .basemap-option {
    display: grid;
    grid-template-columns: 38px minmax(0, 1fr);
    align-items: center;
    gap: 8px;
    min-height: 42px;
    padding: 5px;
    border-radius: 6px;
    cursor: pointer;
}
.basemap-menu .basemap-option:hover:not(.is-disabled), .basemap-menu .basemap-option.is-active { background: rgba(47, 128, 237, 0.20); }
.basemap-menu .basemap-option input { position: absolute; opacity: 0; }
.basemap-menu .basemap-option-label { text-align: left; }
.basemap-menu .basemap-option.is-active .basemap-option-label { color: #81b6ff; }

/* Compact TaskList filters: values open on demand, results consume remaining space. */
.app-topbar {
    grid-template-columns: minmax(220px, 380px) minmax(0, 1fr);
}
.map-toolbar { justify-content: flex-end; }
body.tasklist-workspace-open .duty-sidebar {
    height: calc(100dvh - var(--topbar-height));
    max-height: calc(100dvh - var(--topbar-height));
}
body.tasklist-workspace-open #dxf-info-panel,
body.tasklist-workspace-open #dxf-info-body,
.tasklist-panel,
.tasklist-panel-content { height: 100%; min-height: 0; }
.tasklist-panel-content { overflow: hidden; }
.tasklist-card--filters {
    z-index: 4;
    flex: 0 0 auto;
    max-height: none;
    overflow: visible;
}
#tasklist-filter-form { overflow: visible; }
.tasklist-filter-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 5px 8px;
}
.tasklist-filter-grid > label,
.tasklist-multiselect { min-width: 0; }
.tasklist-actions { margin-top: 6px; }
.tasklist-actions button { height: 32px; min-height: 32px; min-width: 82px; }
.tasklist-date-range { display: grid; grid-column: 1 / -1; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 8px; }
.tasklist-date-range label { min-width: 0; }
.tasklist-actions { grid-template-columns: repeat(3,minmax(0,1fr)); }
.tasklist-actions button { min-width: 0; padding-right: 8px; padding-left: 8px; }
@media (max-width: 520px) { .tasklist-date-range { grid-template-columns: 1fr 1fr; } .tasklist-actions { grid-template-columns: repeat(2,minmax(0,1fr)); } }
.tasklist-card--results {
    z-index: 1;
    flex: 1 1 0;
    min-height: 0;
    max-height: none;
    overflow: hidden;
}
.tasklist-card--results .tasklist-section-head { flex: 0 0 auto; }
.tasklist-table-wrap { flex: 1 1 auto; min-height: 0; overflow: auto; }
.tasklist-record-details { z-index: 8; }
@supports not (height: 100dvh) {
    body.tasklist-workspace-open .duty-sidebar {
        height: calc(100vh - var(--topbar-height));
        max-height: calc(100vh - var(--topbar-height));
    }
}
@media (max-width: 620px) {
    .tasklist-filter-grid { grid-template-columns: 1fr; }
    .app-topbar { grid-template-columns: 40px minmax(0, 1fr); }
}

.axis-map-status { position:absolute; top:calc(var(--topbar-height) + 32px); right:90px; z-index:16; display:flex; min-width:190px; flex-direction:column; padding:9px 13px; border:1px solid rgba(79,220,130,.45); border-radius:8px; background:rgba(7,22,18,.94); color:#eafff1; box-shadow:var(--shadow); font-size:12px; line-height:1.45; pointer-events:none; }
.axis-map-status #axis-map-status-name { color:#65f09a; }

/* TaskList workspace: compact, user-facing filtering layout. */
:root { --topbar-height: 58px; }
.app-topbar { gap: 14px; padding: 0 14px; }
.app-menu-btn { width: 38px; height: 38px; font-size: 22px; }
.app-topbar-title { font-size: 15px; }
.app-topbar-subtitle { margin-top: 1px; font-size: 10px; }
.topbar-search { height: 36px; }
.map-tool-btn { min-width: 68px; height: 42px; padding: 5px 8px; }
body.tasklist-workspace-open { --sidebar-width: clamp(560px, 44vw, 680px); }
body.tasklist-workspace-open .duty-sidebar { height: calc(100vh - var(--topbar-height)); overflow-y: auto; overscroll-behavior: contain; }
.tasklist-panel[open] { min-height: calc(100vh - var(--topbar-height) - 52px); overflow: hidden; }
.tasklist-panel > summary { padding: 10px 16px; }
.tasklist-panel-content { gap: 8px; padding: 10px 12px 12px; overflow-y: auto; }
.tasklist-intro { margin: 0; color: #91a5b7; font-size: 11px; }
.tasklist-card { padding: 10px; }
.tasklist-card--filters { position: relative; z-index: 4; }
.tasklist-section-head { margin-bottom: 8px; }
.tasklist-filter-section { min-width: 0; margin: 0 0 9px; padding: 8px 9px 9px; border: 1px solid rgba(154,180,205,.13); border-radius: 8px; }
.tasklist-filter-section:last-child { margin-bottom: 0; }
.tasklist-filter-section legend { padding: 0 5px; color: #86b9f8; font-size: 9px; font-weight: 400; letter-spacing: .06em; text-transform: uppercase; }
.tasklist-filter-grid { gap: 8px; }
.tasklist-filter-grid input { height: 36px; }
.tasklist-actions { position: sticky; bottom: 0; z-index: 10; grid-template-columns: 1fr 1fr; margin: 9px -10px -10px; padding: 9px 10px 10px; background: #0d2234; border-top: 1px solid rgba(255,255,255,.1); }
.tasklist-actions button { min-height: 38px; }
.tasklist-card--results { flex: 0 0 min(330px, 42vh); min-height: 210px; z-index: 1; }
.tasklist-table-wrap { min-height: 120px; max-width: 100%; overflow: auto; }
.tasklist-record-details { max-height: 130px; margin-top: 8px; }

@media (max-width: 1100px) and (min-width: 821px) {
    body.tasklist-workspace-open { --sidebar-width: clamp(480px, 52vw, 560px); }
}

@media (max-width: 820px) {
    :root { --topbar-height: 56px; --rail-width: 0px; }
    body.tasklist-workspace-open { --sidebar-width: 100vw; }
    .app-topbar-brand, .topbar-search { display: none; }
    .app-topbar { grid-template-columns: 40px 1fr; }
    .map-toolbar { justify-content: flex-end; }
    .tasklist-card--results { flex-basis: 300px; }
}

/* Główny moduł kontroli lokalnego cache TaskList. */
body.tasklist-workspace-open { --sidebar-width: clamp(520px, 40vw, 620px); }
body.tasklist-workspace-open #dxf-info-body > .dxf-info-search,
body.tasklist-workspace-open #dxf-info-body > .dxf-info-list-scroll { display: none; }
.tasklist-panel { flex: 0 1 auto; min-height: 0; border-bottom: 1px solid var(--line); color: #d8e2ec; }
.tasklist-panel[open] { flex: 1 1 auto; display: flex; flex-direction: column; }
.tasklist-panel > summary { display: flex; align-items: center; gap: 10px; padding: 15px 18px; border-bottom: 1px solid rgba(255,255,255,.08); color: #f1f7fd; font-size: 13px; font-weight: 400; text-transform: uppercase; cursor: pointer; }
.tasklist-panel > summary small { margin-left: auto; color: #8296a9; font-size: 10px; font-weight: 400; letter-spacing: .02em; text-transform: none; }
.tasklist-panel-content { display: flex; flex: 1 1 auto; flex-direction: column; gap: 12px; min-height: 0; max-height: 100%; padding: 14px; overflow: hidden; overscroll-behavior: contain; }
.tasklist-card { flex: 0 0 auto; padding: 14px; border: 1px solid rgba(154,180,205,.14); border-radius: 10px; background: rgba(14,31,47,.78); box-shadow: 0 8px 20px rgba(0,0,0,.14); }
.tasklist-card--results { display: flex; flex: 1 1 230px; min-height: 180px; max-width: 100%; flex-direction: column; overflow: hidden; }
.tasklist-section-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 12px; }
.tasklist-section-head h3 { margin: 0; color: #e9f2fa; font-size: 12px; font-weight: 400; letter-spacing: .05em; text-transform: uppercase; }
.tasklist-message { min-width: 0; padding: 5px 9px; border: 1px solid rgba(117,156,193,.16); border-radius: 999px; background: rgba(117,156,193,.1); color: #adc0d2; font-size: 10px; line-height: 1.35; text-align: right; }
.tasklist-message.is-error { border-color: rgba(255,107,107,.3); background: rgba(190,55,55,.16); color: #ffc0c0; }
.tasklist-panel.is-loading .tasklist-message::before { content: ""; display: inline-block; width: 8px; height: 8px; margin-right: 6px; border: 2px solid rgba(255,255,255,.25); border-top-color: #83b8ff; border-radius: 50%; animation: tasklist-spin .7s linear infinite; }
@keyframes tasklist-spin { to { transform: rotate(360deg); } }
.tasklist-status-grid { display: grid; grid-template-columns: repeat(3,minmax(0,1fr)); gap: 8px; margin: 0; }
.tasklist-status-grid > div { min-width: 0; padding: 10px 11px; border: 1px solid rgba(255,255,255,.09); border-radius: 8px; background: rgba(3,13,23,.42); }
.tasklist-status-grid dt { color: #8397aa; font-size: 9px; font-weight: 400; letter-spacing: .05em; text-transform: uppercase; }
.tasklist-status-grid dd { margin: 4px 0 0; overflow: hidden; color: #edf5fc; font-size: 14px; font-weight: 400; text-overflow: ellipsis; white-space: nowrap; }
.tasklist-badge { display: inline-flex; width: auto; padding: 2px 7px; border-radius: 999px; background: rgba(144,160,178,.16); font-size: 10px !important; }
.tasklist-badge.is-ok { background: rgba(49,181,114,.17); color: #82e6b1; }
.tasklist-badge.is-error { background: rgba(215,70,70,.18); color: #ffaaaa; }
.tasklist-filter-grid { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 12px; }
.tasklist-filter-grid label { display: flex; min-width: 0; flex-direction: column; gap: 6px; color: #adbecd; font-size: 11px; font-weight: 400; }
.tasklist-filter-grid input,.tasklist-filter-grid select { width: 100%; min-width: 0; height: 40px; padding: 0 11px; border: 1px solid rgba(162,187,211,.2); border-radius: 7px; background: #0a1b2b; color: #edf5fc; outline: 0; color-scheme: dark; }
.tasklist-filter-grid select[multiple] { height: 102px; padding: 5px; overflow-x: hidden; }
.tasklist-filter-grid select[multiple] option { min-height: 22px; padding: 3px 6px; border-radius: 4px; overflow: hidden; text-overflow: ellipsis; }
.tasklist-filter-grid label span small { color: #71879a; font-size: 9px; }
.tasklist-multiselect-help { grid-column: 1 / -1; margin: -3px 0 0; color: #8095a8; font-size: 10px; }
.tasklist-filter-grid select option { background: #0a1b2b; color: #edf5fc; }
.tasklist-filter-grid input::placeholder { color: #657c90; }
.tasklist-filter-grid input:focus,.tasklist-filter-grid select:focus { border-color: #4d98f5; box-shadow: 0 0 0 3px rgba(47,128,237,.17); }
.tasklist-multiselect { min-width: 0; }
.tasklist-multiselect[hidden] { display: none; }
.tasklist-actions { display: grid; grid-template-columns: repeat(auto-fit,minmax(120px,1fr)); gap: 8px; }
.tasklist-actions button { min-height: 44px; padding: 8px 10px; border: 1px solid rgba(130,164,196,.28); border-radius: 7px; background: #162d42; color: #dcecff; font-size: 10px; font-weight: 400; line-height: 1.25; white-space: nowrap; cursor: pointer; transition: background .15s,border-color .15s,opacity .15s; }
.tasklist-actions button:hover:not(:disabled) { border-color: rgba(113,173,255,.65); background: #20415f; }
.tasklist-actions button.tasklist-button--primary { border-color: #4a9aff; background: linear-gradient(135deg,#1f6feb,#348cf7); color: #fff; box-shadow: 0 5px 14px rgba(31,111,235,.25); }
.tasklist-actions button.tasklist-button--primary.is-dirty { border-color: #ff8b8b; background: linear-gradient(135deg,#b42318,#dc2626); box-shadow: 0 5px 16px rgba(220,38,38,.38); }
.tasklist-actions button:disabled { opacity: .42; cursor: not-allowed; }
.tasklist-results-summary { color: #8fa4b8; font-size: 10px; font-weight: 400; }
.tasklist-table-wrap { flex: 1 1 auto; min-height: 130px; overflow: auto; overscroll-behavior: contain; border: 1px solid rgba(255,255,255,.1); border-radius: 8px; background: rgba(3,12,21,.48); }
.tasklist-results-table { width: 100%; min-width: 1280px; table-layout: fixed; border-collapse: collapse; font-size: 10px; }
.tasklist-results-table th,.tasklist-results-table td { padding: 9px 8px; border-bottom: 1px solid rgba(255,255,255,.07); text-align: left; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tasklist-results-table th { position: sticky; top: 0; z-index: 2; background: #13283b; color: #91c1ff; font-size: 9px; letter-spacing: .04em; text-transform: uppercase; }
.tasklist-results-table .tasklist-col-order { width: 112px; min-width: 112px; max-width: 130px; white-space: nowrap; }
.tasklist-results-table td { color: #d6e0e9; cursor: pointer; }
.tasklist-results-table tbody tr:hover,.tasklist-results-table tbody tr.is-selected { background: rgba(47,128,237,.17); }
.tasklist-results-table tbody tr:focus { outline: 2px solid #4d98f5; outline-offset: -2px; }
.tasklist-record-details { flex: 0 0 auto; max-height: min(220px,35vh); margin-top: 12px; padding: 12px; overflow-x: hidden; overflow-y: auto; border: 1px solid rgba(101,158,220,.22); border-radius: 8px; background: rgba(5,17,29,.75); }
.tasklist-record-details h4 { margin: 0 0 10px; color: #91c1ff; font-size: 11px; text-transform: uppercase; }
.tasklist-record-details dl { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 7px 14px; margin: 0; }
.tasklist-record-details dl > div { min-width: 0; }
.tasklist-record-details dt { color: #7f94a7; font-size: 9px; font-weight: 400; text-transform: uppercase; }
.tasklist-record-details dd { margin: 2px 0 0; color: #e3edf5; font: 11px Consolas,"Courier New",monospace; white-space: pre-wrap; overflow-wrap: anywhere; }
.dxf-canvas-popup-value { white-space: pre-wrap; overflow-wrap: anywhere; }
.dxf-canvas-popup-row { margin-top: 4px; }
.dxf-canvas-detail-popup .maplibregl-popup-content {
    max-height: min(70vh, 520px);
    overflow-y: auto;
    border: 1px solid rgba(125, 174, 226, 0.42);
    opacity: 1;
    background: #0b1522;
    box-shadow: 0 18px 50px rgba(0, 0, 0, 0.86);
    backdrop-filter: none;
}
.dxf-canvas-detail-popup .maplibregl-popup-close-button {
    color: #eef6ff;
}

@media (max-width: 820px) {
    body.tasklist-workspace-open { --sidebar-width: 100vw; }
    .tasklist-panel > summary small { display: none; }
    .tasklist-panel-content { padding: 10px; }
    .tasklist-status-grid { grid-template-columns: repeat(2,minmax(0,1fr)); }
    .tasklist-actions { grid-template-columns: repeat(2,minmax(0,1fr)); }
    .tasklist-actions .tasklist-button--primary { grid-column: 1 / -1; grid-row: 1; }
}

@media (max-width: 540px) {
    .tasklist-filter-grid,.tasklist-record-details dl { grid-template-columns: 1fr; }
    .tasklist-section-head { align-items: flex-start; flex-direction: column; }
    .tasklist-message { width: 100%; border-radius: 7px; text-align: left; }
}

/* Lepsza czytelność dropdownu "Porównaj z" */
body.v2-shell .history-raster-select {
    background: #ffffff;
    color: #000000;
    border-color: #777777;
}

body.v2-shell .history-raster-select option {
    background: #ffffff;
    color: #000000;
}

/* Wyniki wyszukiwania w topbarze */
.global-search-results {
    position: absolute;
    top: calc(100% + 6px);
    left: 0;
    right: 0;
    z-index: 80;
    max-height: 300px;
    overflow-y: auto;
    background: rgba(8, 18, 29, 0.98);
    border: 1px solid rgba(255, 255, 255, 0.16);
    border-radius: 8px;
    box-shadow: 0 14px 28px rgba(0, 0, 0, 0.35);
}

.global-search-results[hidden] {
    display: none !important;
}

.global-search-result {
    display: block;
    width: 100%;
    text-align: left;
    padding: 10px 12px;
    border: 0;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
    background: transparent;
    color: #eaf2fa;
    cursor: pointer;
}

.global-search-result:last-child {
    border-bottom: 0;
}

.global-search-result:hover,
.global-search-result.is-active {
    background: rgba(47, 128, 237, 0.28);
}

.global-search-result-primary {
    display: block;
    font-size: 12px;
    font-weight: 400;
    color: #ffffff;
}

.global-search-result-secondary {
    display: block;
    margin-top: 2px;
    font-size: 11px;
    color: #b9c9d8;
}

/* Usunięto side-rail — nie zostawiaj pustego miejsca po lewej. */
:root {
    --rail-width: 0px;
}

@media (max-width: 820px) {
    :root {
        --rail-width: 0px;
        --sidebar-width: 100vw;
    }
}

/* Ikona aparatu przy mapie (zrzut ekranu) */
.map-quick-btn--camera {
    font-size: 0;
}

.map-quick-btn--camera svg {
    width: 22px;
    height: 22px;
    display: block;
    fill: none;
    stroke: #d9e3ee;
    stroke-width: 2;
    stroke-linecap: round;
    stroke-linejoin: round;
}

/* Notatki mapowe */
.map-tool-dropdown {
    position: relative;
    display: inline-flex;
}

.map-tool-menu {
    position: absolute;
    top: calc(100% + 6px);
    right: 0;
    z-index: 40;
    min-width: 220px;
    padding: 6px;
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: 8px;
    background: rgba(10, 20, 31, 0.98);
    box-shadow: 0 14px 36px rgba(0, 0, 0, 0.38);
}

.map-tool-menu[hidden] {
    display: none !important;
}

.map-tool-menu-item {
    display: block;
    width: 100%;
    padding: 10px 12px;
    border: 0;
    border-radius: 6px;
    background: transparent;
    color: #e3ecf4;
    font-size: 12px;
    font-weight: 400;
    text-align: left;
    cursor: pointer;
}

.map-tool-menu-item:hover {
    background: rgba(47, 128, 237, 0.22);
    color: #fff;
}

.map-tool-btn.is-add-mode {
    background: rgba(255, 107, 53, 0.22);
    color: #ffb48a;
    box-shadow: inset 0 0 0 1px rgba(255, 140, 90, 0.45);
}

.map-notes-panel,
.map-note-form-panel {
    position: absolute;
    top: calc(var(--topbar-height) + 18px);
    right: 22px;
    z-index: 23;
    width: min(400px, calc(100vw - 44px));
    max-height: calc(100vh - var(--topbar-height) - 36px);
    display: flex;
    flex-direction: column;
    color: var(--text);
    background: rgba(10, 20, 31, 0.96);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 8px;
    box-shadow: var(--shadow);
    overflow: hidden;
}

.map-notes-panel[hidden],
.map-note-form-panel[hidden] {
    display: none !important;
}

.map-notes-panel-header,
.map-note-form-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    padding: 14px 16px 12px;
    border-bottom: 1px solid var(--line);
}

.map-notes-panel-title,
.map-note-form-title {
    margin: 0;
    color: #d5dee8;
    font-size: 13px;
    font-weight: 400;
    text-transform: uppercase;
}

.map-notes-panel-close,
.map-note-form-close {
    width: 30px;
    height: 30px;
    border: 0;
    border-radius: 8px;
    background: transparent;
    color: #a9b8c8;
    font-size: 22px;
    cursor: pointer;
}

.map-notes-panel-close:hover,
.map-note-form-close:hover {
    background: rgba(255, 255, 255, 0.08);
    color: #fff;
}

.map-notes-panel-message {
    padding: 14px 16px;
    color: var(--muted);
    font-size: 12px;
}

.map-notes-list {
    flex: 1 1 auto;
    min-height: 0;
    overflow-y: auto;
    padding: 10px 12px 14px;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.map-notes-list-item {
    padding: 10px 12px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.04);
}

.map-notes-list-meta {
    display: flex;
    justify-content: space-between;
    gap: 8px;
    margin-bottom: 6px;
    color: #8fa2b4;
    font-size: 10px;
    font-weight: 400;
}

.map-notes-list-text {
    color: #e8f0f7;
    font-size: 12px;
    line-height: 1.4;
    margin-bottom: 8px;
    word-break: break-word;
}

.map-notes-list-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}

.map-note-btn {
    min-height: 30px;
    padding: 5px 10px;
    border: 1px solid rgba(163, 180, 198, 0.22);
    border-radius: 6px;
    background: rgba(255, 255, 255, 0.06);
    color: #d8e4ef;
    font-size: 11px;
    font-weight: 400;
    cursor: pointer;
}

.map-note-btn:hover {
    background: rgba(47, 128, 237, 0.18);
    border-color: rgba(95, 164, 255, 0.45);
}

.map-note-btn--primary {
    border-color: rgba(113, 173, 255, 0.38);
    background: linear-gradient(135deg, #1f6feb, #2f80ed);
    color: #fff;
}

.map-note-form-body {
    display: flex;
    flex-direction: column;
    gap: 10px;
    padding: 14px 16px 16px;
    overflow-y: auto;
}

.map-note-field {
    color: #9fb0c0;
    font-size: 11px;
    font-weight: 400;
    text-transform: uppercase;
}

.map-note-textarea {
    width: 100%;
    min-height: 110px;
    padding: 10px 12px;
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.05);
    color: #edf5fc;
    resize: vertical;
}

.map-note-readonly-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
}

.map-note-readonly-full {
    grid-column: 1 / -1;
}

.map-note-field-label {
    display: block;
    color: #8fa2b4;
    font-size: 10px;
    font-weight: 400;
    text-transform: uppercase;
}

.map-note-field-value {
    display: block;
    margin-top: 2px;
    color: #e8f0f7;
    font-size: 12px;
    font-weight: 400;
    font-family: Consolas, "Courier New", monospace;
}

.map-note-form-actions {
    display: flex;
    gap: 8px;
}

.map-note-form-actions .map-note-btn {
    flex: 1 1 auto;
}

body.map-note-add-mode #map {
    cursor: crosshair !important;
}

/* Final cascade for the TaskList workspace. */
body.tasklist-workspace-open { --sidebar-width: clamp(560px, 44vw, 680px); }
.tasklist-panel-content { overflow-y: auto; }
.tasklist-card--results { flex: 0 0 min(330px, 42vh); }
.tasklist-actions { position: sticky; bottom: 0; z-index: 10; grid-template-columns: 1fr 1fr; }
@media (max-width: 1100px) and (min-width: 821px) { body.tasklist-workspace-open { --sidebar-width: clamp(480px, 52vw, 560px); } }
@media (max-width: 820px) { body.tasklist-workspace-open { --sidebar-width: 100vw; } }

.popup-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-top: 10px;
    padding-top: 10px;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
}

/* TaskList panel: final layout and viewport behavior. */
.duty-sidebar { height: calc(100vh - var(--topbar-height)); max-height: calc(100vh - var(--topbar-height)); }
body.tasklist-workspace-open .duty-sidebar { overflow-y: auto; overflow-x: hidden; }
.dxf-info-panel { flex: 0 0 auto; min-height: 100%; overflow: visible; }
.dxf-info-panel-header { position: sticky; top: 0; z-index: 40; min-height: 48px; background: #0d2031; }
.dxf-info-panel-title { text-transform: none; }
.tasklist-panel { display: block; min-height: 0; overflow: visible; }
.tasklist-panel-content { display: block; max-height: none; overflow: visible; }
.tasklist-intro { margin-bottom: 10px; }
.tasklist-card--results { display: flex; min-height: 240px; max-height: 58vh; margin-top: 12px; overflow: hidden; }
.tasklist-field-label { display: block; margin-bottom: 6px; color: #adbecd; font-size: 11px; font-weight: 400; }
.tasklist-multiselect { position: relative; }
.tasklist-panel-toggle { margin-left: auto; padding: 6px 9px; border: 1px solid rgba(150,180,210,.25); border-radius: 6px; background: rgba(255,255,255,.06); color: #cbd8e4; font-size: 10px; cursor: pointer; }
.tasklist-show-panel { position: fixed; top: calc(var(--topbar-height) + 12px); left: 10px; z-index: 45; padding: 9px 12px; border: 1px solid rgba(100,165,245,.5); border-radius: 7px; background: #102b43; color: #dcecff; font-weight: 400; cursor: pointer; }
.tasklist-show-panel[hidden] { display: none; }
body.tasklist-panel-hidden .duty-sidebar { transform: translateX(-100%); }
body.tasklist-panel-hidden { --sidebar-width: 0px; }
body.sidebar-collapsed { --map-left-offset: 0px; }
body.tasklist-panel-hidden { --map-left-offset: 0px; }
.tasklist-results-table th[hidden] { display: none; }

/* TaskList workspace: viewport-safe, compact filters with persistent results. */
body.tasklist-workspace-open .duty-sidebar {
    bottom: auto;
    height: calc(100dvh - var(--topbar-height));
    max-height: calc(100dvh - var(--topbar-height));
    overflow: hidden;
}
body.tasklist-workspace-open #dxf-info-panel,
body.tasklist-workspace-open #dxf-info-body,
.tasklist-panel,
.tasklist-panel-content { min-height: 0; }
body.tasklist-workspace-open #dxf-info-panel { flex: 1 1 auto; max-height: 100%; overflow: hidden; }
body.tasklist-workspace-open #dxf-info-body { flex: 1 1 auto; overflow: hidden; }
.tasklist-panel { display: flex; flex: 1 1 auto; flex-direction: column; overflow: hidden; }
.tasklist-panel-content {
    display: flex;
    flex: 1 1 auto;
    flex-direction: column;
    gap: 6px;
    max-height: 100%;
    padding: 7px 10px 10px;
    overflow: hidden;
}
.tasklist-intro { flex: 0 0 auto; margin: 0; line-height: 1.25; }
.tasklist-card { padding: 8px; }
.tasklist-card--filters { display: flex; flex: 0 1 286px; min-height: 112px; flex-direction: column; overflow: visible; }
.tasklist-card--filters .tasklist-section-head { flex: 0 0 auto; }
#tasklist-filter-form { min-height: 0; overflow-x: hidden; overflow-y: auto; scrollbar-gutter: stable; }
.tasklist-section-head { margin-bottom: 5px; }
.tasklist-filter-section { margin: 0 0 5px; padding: 5px 7px 6px; }
.tasklist-filter-section legend { font-size: 8px; }
.tasklist-filter-grid { gap: 5px 7px; }
.tasklist-filter-grid label { gap: 3px; font-size: 10px; }
.tasklist-filter-grid input { height: 34px; }
.tasklist-field-label { margin-bottom: 3px; font-size: 10px; }
.tasklist-actions {
    position: static;
    display: flex;
    flex: 0 0 auto;
    gap: 7px;
    margin: 6px 0 0;
    padding: 0;
    border: 0;
    background: transparent;
}
.tasklist-actions button { width: auto; min-width: 108px; min-height: 36px; height: 36px; padding: 5px 14px; }
.tasklist-card--results { position: relative; display: flex; flex: 1 1 320px; min-height: 260px; max-height: none; margin-top: 0; overflow: hidden; }
.tasklist-table-wrap { flex: 1 1 auto; min-height: 0; }
.tasklist-results-table th,.tasklist-results-table td { padding-top: 7px; padding-bottom: 7px; }
.tasklist-record-details {
    position: absolute;
    right: 8px;
    bottom: 8px;
    left: 8px;
    z-index: 5;
    max-height: min(160px,35%);
    margin: 0;
    padding: 10px 36px 10px 10px;
    overflow: auto;
    box-shadow: 0 -8px 24px rgba(0,0,0,.45);
}
.tasklist-record-details-close { position: absolute; top: 5px; right: 7px; width: 26px; height: 26px; padding: 0; border: 0; border-radius: 5px; background: rgba(255,255,255,.08); color: #dce8f3; font-size: 20px; cursor: pointer; }

.tasklist-dxf-canvas-button { margin-top: 10px; }
.dxf-canvas-map-overlay-wrap { position: absolute; inset: 0; z-index: 30; overflow: visible; pointer-events: none; }
.dxf-canvas-map-overlay { position: absolute; inset: 0; width: 100%; height: 100%; z-index: 30; pointer-events: none; }
.dxf-canvas-map-status { position: absolute; z-index: 50; right: 12px; bottom: 42px; max-width: min(680px, calc(100% - 24px)); padding: 8px 10px; border: 1px solid rgba(113,174,252,.45); border-radius: 8px; background: rgba(7,17,26,.9); color: #e9f2fb; font-size: 12px; line-height: 1.35; pointer-events: none; }
.dxf-canvas-map-status button { padding: 6px 9px; }
.dxf-canvas-map-status[hidden] { display: none; }
.dxf-canvas-map-overlay { transform-origin: 0 0; will-change: transform; }
.dxf-canvas-options { display: grid; grid-template-columns: 1fr; gap: 6px; margin-top: 10px; }
.dxf-canvas-options label { display: flex; align-items: center; gap: 7px; color: #c8d4df; font-size: 11px; }
.dxf-canvas-options input { width: 14px; height: 14px; accent-color: #4f9bff; }
.history-raster-debug { margin: 0; padding: 8px 14px; max-height: 92px; overflow: auto; border-bottom: 1px solid rgba(255,255,255,.1); color: #a9c8e8; background: rgba(2,10,17,.55); font: 10px/1.35 Consolas, monospace; white-space: pre-wrap; }
.tasklist-show-panel { top: calc(var(--topbar-height) + 10px); left: 10px; padding: 7px 10px; }
@supports not (height: 100dvh) {
    body.tasklist-workspace-open .duty-sidebar { height: calc(100vh - var(--topbar-height)); max-height: calc(100vh - var(--topbar-height)); }
}
@media (max-height: 760px) {
    .tasklist-card--filters { flex-basis: 230px; }
    .tasklist-card--results { min-height: 260px; }
}

/* TaskList: always-visible, dense filter workspace. */
body.tasklist-workspace-open .dxf-info-panel-header {
    min-height: 34px;
    padding: 4px 10px;
}
body.tasklist-workspace-open .dxf-info-panel-title { font-size: 12px; }
body.tasklist-workspace-open .duty-sidebar-back-btn { width: 26px; height: 26px; }
.tasklist-panel-toggle { padding: 4px 7px; }
.tasklist-panel-content { padding-top: 5px; }
.tasklist-card--filters { flex: 0 0 auto; max-height: min(390px, 46dvh); overflow: hidden; }
#tasklist-filter-form { overflow-y: auto; }
.tasklist-filter-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 6px 8px; }
.tasklist-filter-grid > label { align-self: start; }
.tasklist-filter-grid input { height: 32px; }
.tasklist-multiselect { display: flex; min-width: 0; flex-direction: column; }
.tasklist-field-label { min-height: 15px; margin: 0 0 2px; }
.tasklist-actions { margin-top: 5px; }
.tasklist-actions button { min-width: 84px; height: 32px; min-height: 32px; padding: 3px 12px; }
.tasklist-card--results { min-height: 220px; }
.tasklist-results-table th,.tasklist-results-table td { padding-top: 5px; padding-bottom: 5px; }
.tasklist-record-details {
    top: 38px;
    right: 8px;
    bottom: 8px;
    left: auto;
    width: min(310px, 70%);
    max-height: none;
    border-left: 1px solid rgba(120,170,225,.28);
    background: #0c2032;
}
.tasklist-record-details dl { grid-template-columns: 1fr; }
@media (max-width: 620px) {
    .tasklist-filter-grid { grid-template-columns: 1fr; }
    .tasklist-card--filters { max-height: 48dvh; }
}

.popup-actions .popup-action-btn {
    flex: 1 1 calc(50% - 6px);
    min-width: 120px;
}

@media (max-width: 820px) {
    .map-notes-panel,
    .map-note-form-panel {
        right: 10px;
        width: calc(100vw - 20px);
    }
}

/* Final TaskList layout overrides. */
.app-topbar { grid-template-columns: minmax(220px, 380px) minmax(0, 1fr); }
.map-toolbar { justify-content: flex-end; }
body.tasklist-workspace-open .duty-sidebar {
    height: calc(100dvh - var(--topbar-height));
    max-height: calc(100dvh - var(--topbar-height));
    overflow: hidden;
}
body.tasklist-workspace-open #dxf-info-panel,
body.tasklist-workspace-open #dxf-info-body,
.tasklist-panel,
.tasklist-panel-content { height: 100%; min-height: 0; }
.tasklist-panel-content { overflow: hidden; }
.tasklist-card--filters { z-index: 4; flex: 0 0 auto; max-height: none; overflow: visible; }
#tasklist-filter-form { overflow: visible; }
.tasklist-filter-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 5px 8px; }
.tasklist-filter-grid input,
.tasklist-multiselect-button { height: 32px; min-height: 32px; }
.tasklist-multiselect-button {
    position: relative;
    width: 100%;
    padding: 7px 30px 6px 9px;
    overflow: hidden;
    border: 1px solid rgba(162,187,211,.2);
    border-radius: 7px;
    background: #0a1b2b;
    color: #dce8f3;
    font-size: 11px;
    font-weight: 400;
    text-align: left;
    text-overflow: ellipsis;
    white-space: nowrap;
    cursor: pointer;
}
.tasklist-multiselect-button::after { position: absolute; top: 50%; right: 10px; content: "▾"; transform: translateY(-50%); }
.tasklist-multiselect-button[aria-expanded="true"] { border-color: #4d98f5; box-shadow: 0 0 0 3px rgba(47,128,237,.17); }
.tasklist-multiselect-button[aria-expanded="true"]::after { content: "▴"; }
.tasklist-floating-dropdown {
    position: fixed;
    z-index: 10000;
    display: flex;
    flex-direction: column;
    min-width: 220px;
    padding: 6px;
    overflow: hidden;
    border: 1px solid rgba(120,165,210,.55);
    border-radius: 8px;
    background: #071827;
    box-shadow: 0 16px 38px rgba(0,0,0,.65);
    color: #dce8f3;
}

/* Kontekst aktywnego projektu i osi. */
.app-topbar {
    grid-template-columns: minmax(210px, 300px) minmax(180px, 1fr) minmax(420px, auto) minmax(110px, auto);
}
.topbar-project-context { min-width: 0; text-align: center; line-height: 1.2; }
#topbar-project-name { overflow: hidden; color: #f2f7fc; font-size: 16px; font-weight: 600; text-overflow: ellipsis; white-space: nowrap; }
#topbar-user-context { overflow:hidden; color:#aab8c6; font-size:11px; text-align:right; text-overflow:ellipsis; white-space:nowrap; }
.project-axis-controls { display: grid; gap: 8px; margin-top: 12px; }
.project-axis-controls > label { color: var(--muted); font-size: 11px; }
#project-axis-select { width: 100%; min-height: 36px; padding: 0 30px 0 10px; border: 1px solid rgba(255,255,255,.14); border-radius: 8px; background: #102235; color: #eef5fb; }
#project-axis-select:disabled { color: #8898a8; cursor: not-allowed; }
@media (max-width: 1040px) {
    .app-topbar { grid-template-columns: minmax(150px, 210px) minmax(110px, 1fr) minmax(340px, auto) 90px; gap: 8px; }
    #topbar-project-name { font-size: 13px; }
}
@media (max-width: 820px) {
    .app-topbar { grid-template-columns: 40px minmax(80px, 1fr) minmax(220px, auto); }
    .topbar-project-context { text-align: left; }
    #topbar-project-name { font-size: 12px; }
    #topbar-user-context { display:none; }
}
@media (max-width: 620px) {
    .app-topbar { grid-template-columns: 40px minmax(0, 1fr) minmax(170px, auto); gap: 5px; padding-inline: 8px; }
    #topbar-project-name { max-width: 28vw; }
    .map-tool-btn { min-width: 39px; padding-inline: 3px; }
    .axis-map-status { top:calc(var(--topbar-height) + 10px); right:70px; min-width:0; flex-direction:row; gap:4px; padding:6px 9px; font-size:10px; }
    .axis-map-status #axis-map-status-name { display:none; }
    .axis-map-status #axis-map-status-chainage::after { content:" ·"; }
}
.tasklist-floating-dropdown[hidden] { display: none; }
.tasklist-floating-dropdown .tasklist-multiselect-search {
    position: static;
    width: 100%;
    min-height: 32px;
    margin: 0 0 5px;
    padding: 0 9px;
    border: 1px solid rgba(162,187,211,.3);
    border-radius: 5px;
    background: #0c2235;
    color: #edf5fc;
    outline: none;
}
.tasklist-floating-dropdown .tasklist-multiselect-search:focus { border-color: #4d98f5; }
.tasklist-floating-dropdown .tasklist-multiselect-options { position: static; max-height: min(260px,38dvh); padding: 2px; overflow-y: auto; scrollbar-gutter: stable; overscroll-behavior: contain; border: 0; background: transparent; box-shadow: none; }
.tasklist-floating-dropdown .tasklist-multiselect-options label { display: flex; min-height: 26px; align-items: center; gap: 7px; padding: 4px 5px; border-radius: 5px; color: #dce8f3; font-size: 11px; cursor: pointer; }
.tasklist-floating-dropdown .tasklist-multiselect-options label:hover { background: rgba(77,152,245,.16); }
.tasklist-floating-dropdown .tasklist-multiselect-options input { width: 15px; height: 15px; flex: 0 0 15px; accent-color: #4d98f5; }
.tasklist-actions { margin-top: 6px; }
.tasklist-actions button { height: 32px; min-height: 32px; min-width: 82px; }
.tasklist-card--results { z-index: 1; flex: 1 1 0; min-height: 0; max-height: none; overflow: hidden; }
.tasklist-table-wrap { flex: 1 1 auto; min-height: 0; overflow: auto; }
.tasklist-record-details { z-index: 8; }
@media (max-width: 620px) {
    .tasklist-filter-grid { grid-template-columns: 1fr; }
    .tasklist-card--filters { max-height: none; }
    .app-topbar { grid-template-columns: 40px minmax(0, 1fr); }
}

/* Końcowy override wag UI musi pozostać po regułach modułu TaskList. */
body.v2-shell { font-weight: 400; }

/* Lżejsza typografia UI; nie wpływa na tekst CAD rysowany na Canvas. */
.app-topbar-title { font-weight: 600; }
.duty-sidebar-section-title,
.dxf-info-panel-title,
.history-raster-panel-title,
.measurement-panel-title,
.tasklist-panel > summary,
.tasklist-section-head h3,
.tasklist-record-details h4 { font-weight: 500; }

/* DXF Load Diagnostics: oddzielony od warstwy Canvas, bez wpływu na renderowanie mapy. */
.dxf-canvas-map-status { cursor: pointer; }
.dxf-canvas-map-status[data-severity="warning"] { border-color: #d99018; }
.dxf-canvas-map-status[data-severity="error"] { border-color: #c33; }
.dxf-canvas-map-status[data-severity="success"] { border-color: #27884a; }
.dxf-diagnostics-panel { position: fixed; inset: 6vh 4vw; z-index: 1300; background: #fff; color: #17202a; border: 1px solid #adb5bd; border-radius: 8px; box-shadow: 0 12px 48px #0005; display: flex; flex-direction: column; padding: 16px; gap: 12px; }
.dxf-diagnostics-panel[hidden] { display: none; }
.dxf-diagnostics-panel header, .dxf-diagnostics-panel footer, .dxf-diagnostics-filters { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.dxf-diagnostics-panel header h2 { margin: 0; flex: 1; font-size: 18px; }
.dxf-diagnostics-panel input, .dxf-diagnostics-panel select, .dxf-diagnostics-panel button, .dxf-diagnostics-panel a { padding: 7px 9px; }
.dxf-diagnostics-table-wrap { overflow: auto; flex: 1; border: 1px solid #ddd; }
.dxf-diagnostics-panel table { width: 100%; border-collapse: collapse; font-size: 13px; }
.dxf-diagnostics-panel th { position: sticky; top: 0; background: #f1f3f5; z-index: 1; }
.dxf-diagnostics-panel th, .dxf-diagnostics-panel td { text-align: left; padding: 7px; border-bottom: 1px solid #e5e7eb; vertical-align: top; }
.dxf-diagnostics-panel tr.severity-warning { background: #fff8e1; }
.dxf-diagnostics-panel tr.severity-error { background: #fff0f0; }
.dxf-diagnostics-panel tr.severity-success { background: #edf9f0; }
.dxf-diagnostics-panel details summary { cursor: pointer; }
.dxf-diagnostics-panel pre { max-width: 520px; white-space: pre-wrap; }
.dxf-diagnostics-panel footer .dxf-diagnostics-page { min-width: 110px; text-align: center; }
.measurement-panel { width: 420px; max-width: calc(100vw - 24px); height: auto; max-height: 78vh; overflow-x: hidden; overflow-y: auto; }
.measurement-crs-label { display: grid; gap: 5px; color: #b8c7d5; font-size: 12px; }
.measurement-crs-label select { min-height: 36px; border: 1px solid rgba(255,255,255,.14); border-radius: 6px; background: #142434; color: #eef5fb; padding: 5px 8px; }
.measurement-table-wrap { max-height: 210px; overflow-x: hidden; overflow-y: auto; border: 1px solid rgba(255,255,255,.1); border-radius: 6px; user-select:text; }
.measurement-points-table { width: 100%; border-collapse: collapse; font-variant-numeric: tabular-nums; }
.measurement-points-table th, .measurement-points-table td { padding: 6px 9px; text-align: right; border-bottom: 1px solid rgba(255,255,255,.08); }
.measurement-points-table th:first-child, .measurement-points-table td:first-child { width: 48px; text-align: center; }
.measurement-actions { display: flex; flex-wrap: wrap; gap: 7px; }
.measurement-actions button { min-height: 34px; border: 1px solid rgba(255,255,255,.14); border-radius: 6px; background: rgba(255,255,255,.07); color: #e7f0f8; padding: 5px 9px; }
.saved-measurements-panel { position:absolute; inset:80px 24px 24px; z-index:90; display:flex; flex-direction:column; color:#e7f0f8; background:rgba(8,18,29,.985); border:1px solid rgba(255,255,255,.14); border-radius:8px; box-shadow:var(--shadow); }
.saved-measurements-panel[hidden]{display:none!important}.saved-measurements-body{padding:12px;min-height:0;display:flex;flex:1;flex-direction:column;gap:10px}.saved-measurements-table-wrap{overflow:auto;flex:1}.saved-measurements-panel table{width:100%;border-collapse:collapse}.saved-measurements-panel th,.saved-measurements-panel td{padding:7px;border-bottom:1px solid rgba(255,255,255,.1);vertical-align:top;text-align:left}.saved-measurements-actions{display:flex;flex-wrap:nowrap;gap:4px;white-space:nowrap}.saved-measurements-actions-column{width:1%;white-space:nowrap}.saved-measurements-select{width:34px;text-align:center!important}.saved-measurements-batch{display:flex;align-items:center;flex-wrap:wrap;gap:8px}.saved-measurements-danger-separator{margin-left:12px;padding-left:16px;border-left:1px solid rgba(255,255,255,.25)}.saved-measurements-panel button,.measurement-confirm-dialog button{padding:5px 7px;background:#142434;color:#eef5fb;border:1px solid rgba(255,255,255,.14);border-radius:5px}.saved-measurements-danger{background:#6f1d24!important;border-color:#d45864!important}.saved-measurements-panel button:disabled,.measurement-confirm-dialog button:disabled{opacity:.45;cursor:not-allowed}.saved-measurements-pager{display:flex;justify-content:center;align-items:center;gap:12px}.measurement-confirm-dialog{max-width:420px;color:#eef5fb;background:#0d1b29;border:1px solid rgba(255,255,255,.2);border-radius:8px}.measurement-confirm-dialog::backdrop{background:rgba(0,0,0,.65)}.measurement-confirm-dialog form,.measurement-confirm-dialog label{display:flex;flex-direction:column;gap:12px}.measurement-confirm-dialog form>div{display:flex;justify-content:flex-end;gap:8px}.measurement-confirm-dialog input{padding:8px}
@media(max-width:620px){.measurement-panel{right:10px;bottom:10px;width:calc(100vw - 20px);max-width:none}.saved-measurements-panel{inset:78px 10px 10px}.saved-measurements-remarks textarea{max-width:45vw}}

/* Ostateczny układ topbara musi pozostać po wszystkich starszych media queries. */
@media (max-width: 820px) {
    .app-topbar { grid-template-columns:40px minmax(80px,1fr) minmax(220px,auto); }
    #topbar-user-context { display:none; }
}
@media (max-width: 620px) {
    .app-topbar { grid-template-columns:40px minmax(0,1fr) minmax(170px,auto); gap:5px; padding-inline:8px; }
}

.ortho-compare-map {
    position: absolute;
    inset: 0;
    z-index: 8;
    width: 100%;
    height: 100%;
    overflow: hidden;
    pointer-events: none;
}

.ortho-compare-map .maplibregl-canvas-container,
.ortho-compare-map canvas {
    z-index: 0;
}

.ortho-compare-map[hidden] {
    display: none !important;
}

.ortho-compare-divider {
    position: absolute;
    top: 0;
    bottom: var(--ortho-bottom-bar-height, 74px);
    left: 50%;
    z-index: 35;
    width: 3px;
    background: rgba(255, 255, 255, 0.95);
    box-shadow: 0 0 0 1px rgba(0, 0, 0, 0.5);
    cursor: ew-resize;
    pointer-events: auto;
    touch-action: none;
}

.ortho-compare-divider[hidden] {
    display: none !important;
}

.ortho-compare-divider-handle {
    position: absolute;
    top: 50%;
    left: 50%;
    width: 34px;
    height: 44px;
    transform: translate(-50%, -50%);
    border: 2px solid rgba(255, 255, 255, 0.96);
    border-radius: 10px;
    background: rgba(8, 18, 29, 0.94);
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.35);
}

.ortho-compare-divider-handle::before {
    content: "";
    position: absolute;
    inset: 10px 14px;
    border-left: 2px solid rgba(255, 255, 255, 0.9);
    border-right: 2px solid rgba(255, 255, 255, 0.9);
}

/* Ortofoto: kompaktowy timeline na dole mapy. */
.map-stage {
    top: 0;
    right: 0;
    bottom: 0;
    left: var(--map-left-offset);
    width: auto;
    height: auto;
}

body.v2-shell .history-raster-panel.history-raster-timeline,
body.dxf-panel-open .history-raster-panel.history-raster-timeline,
body.dxf-panel-open.sidebar-collapsed .history-raster-panel.history-raster-timeline {
    position: absolute;
    left: 12px;
    right: 12px;
    bottom: 14px;
    z-index: 24;
    width: auto;
    max-width: none;
    height: 68px;
    min-height: 68px;
    max-height: 68px;
    box-sizing: border-box;
    transform: none;
    color: #eaf2fa;
    background: rgba(8, 18, 29, 0.94);
    border: 1px solid rgba(142, 180, 220, 0.28);
    border-radius: 8px;
    box-shadow: 0 14px 34px rgba(0, 0, 0, 0.42);
    overflow: hidden;
}

body.v2-shell .history-raster-panel.history-raster-timeline,
body.dxf-panel-open .history-raster-panel.history-raster-timeline,
body.dxf-panel-open.sidebar-collapsed .history-raster-panel.history-raster-timeline,
.app-topbar,
.duty-sidebar,
.map-tool-menu,
.tasklist-floating-dropdown {
    z-index: 50;
}

.history-raster-timeline .history-raster-panel-body {
    display: grid;
    grid-template-rows: 1fr;
    gap: 0;
    height: 100%;
    padding: 5px 16px;
    overflow: hidden;
}

.history-raster-timeline .history-raster-timeline-head {
    display: grid;
    grid-template-columns: auto minmax(320px, 1fr) auto 120px 42px auto auto 34px;
    align-items: center;
    gap: 8px;
    min-width: 0;
    min-height: 34px;
}

.history-raster-timeline .history-raster-current-date {
    min-width: 0;
    overflow: hidden;
    color: #8fbeff;
    font-size: 11px;
    font-weight: 600;
    text-align: center;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.history-raster-timeline .history-raster-enabled-controls {
    display: contents;
}

.history-raster-timeline .history-raster-enabled-controls[hidden] { display: contents !important; }
.history-raster-timeline .history-raster-opacity-label { color: #cbd8e5; font-size: 10px; white-space: nowrap; }
.history-raster-timeline .history-raster-opacity-label-long { display: none; }
.history-raster-timeline .history-raster-opacity-label-short { display: inline; }
.history-raster-timeline .history-raster-opacity { width: 120px; min-width: 90px; max-width: 150px; box-sizing: border-box; margin: 0; accent-color: #4f9bff; cursor: pointer; }
.history-raster-timeline .history-raster-opacity-value { width: 42px; min-width: 42px; color: #eaf2fa; font-size: 10px; text-align: right; }

.history-raster-timeline .history-raster-year-row {
    display: block;
    min-width: 0;
    padding-right: 18px;
    padding-left: 18px;
    overflow: hidden;
}

.history-raster-timeline .history-raster-list {
    --ordinary-marker-size: 8px;
    --active-marker-size: 12px;
    position: relative;
    display: block;
    height: 48px;
    margin: 0;
    min-width: 0;
    overflow: visible;
    touch-action: manipulation;
}

.history-raster-timeline .history-raster-timeline-track {
    position: absolute;
    top: 23px;
    right: 0;
    left: 0;
    height: 1px;
    background: rgba(170, 202, 232, 0.55);
}

.history-raster-timeline .history-raster-list-item {
    --marker-size: var(--ordinary-marker-size);
    position: absolute;
    top: 9px;
    width: 28px;
    height: 28px;
    padding: 0;
    transform: translateX(-50%);
    border: 0;
    border-radius: 50%;
    background: transparent;
    color: #d9e6f2;
    text-align: center;
    cursor: pointer;
}

.history-raster-timeline .history-raster-list-item::before {
    content: "";
    position: absolute;
    top: 50%;
    left: 50%;
    width: var(--marker-size);
    height: var(--marker-size);
    box-sizing: border-box;
    transform: translate(-50%, -50%);
    border-radius: 50%;
    background: #9cb4c9;
}

.history-raster-timeline .history-raster-list-item:hover { --marker-size: 10px; }

.history-raster-timeline .history-raster-list-item-line--primary {
    position: absolute;
    bottom: 31px;
    left: 50%;
    min-width: 58px;
    overflow: hidden;
    color: inherit;
    font-size: 10px;
    line-height: 14px;
    text-overflow: ellipsis;
    transform: translateX(-50%);
    white-space: nowrap;
    opacity: 0.68;
}

.history-raster-timeline .history-raster-list-item:first-of-type .history-raster-list-item-line--primary { left: 0; transform: none; text-align: left; }
.history-raster-timeline .history-raster-list-item:last-child .history-raster-list-item-line--primary { right: 0; left: auto; transform: none; text-align: right; }
.history-raster-timeline .history-raster-list-item.is-selected .history-raster-list-item-line--primary,
.history-raster-timeline .history-raster-list-item.is-compare-a .history-raster-list-item-line--primary,
.history-raster-timeline .history-raster-list-item.is-compare-b .history-raster-list-item-line--primary { font-weight: 700; opacity: 1; }

.duty-sidebar-section--pzt-raster { display:flex; flex-direction:column; gap:8px; padding-top:12px; padding-bottom:12px; }
.pzt-raster-header { display:flex; align-items:center; justify-content:space-between; gap:10px; }
.pzt-raster-expand { display:flex; flex:1; align-items:center; gap:8px; padding:4px 0; border:0; background:transparent; text-align:left; cursor:pointer; }
.pzt-raster-state { padding:2px 5px; border-radius:4px; background:rgba(126,143,162,.2); color:#aebdca; font-size:9px; }
.pzt-raster-state.is-on { background:rgba(47,128,237,.25); color:#8fbeff; }
.pzt-raster-chevron { margin-left:auto; transition:transform .15s ease; }
.pzt-raster-expand[aria-expanded="true"] .pzt-raster-chevron { transform:rotate(180deg); }
.pzt-raster-details { display:flex; flex-direction:column; gap:8px; padding-top:4px; }
.pzt-raster-details[hidden] { display:none!important; }
.pzt-raster-opacity { display: grid; grid-template-columns:auto 1fr auto; align-items:center; gap:8px; font-size:11px; color:#cbd8e5; }
#pzt-raster-fit { min-height:28px; border:1px solid rgba(143,190,255,.35); border-radius:6px; background:rgba(47,128,237,.16); color:#e9f2fb; font-size:10px; }
.pzt-raster-info,.pzt-raster-current-zoom { margin:0; color:#aebdca; font-size:10px; line-height:1.35; }
.map-zoom-debug { position:absolute; right:14px; left:auto!important; bottom:14px; z-index:12; padding:3px 6px; border-radius:4px; background:rgba(8,18,29,.66)!important; color:#d7e4f0; font-size:10px; line-height:1.2; pointer-events:none; }
@media(max-width:820px) { .map-zoom-debug { right:7px; bottom:7px; padding:2px 4px; font-size:9px; } }

.history-raster-timeline .history-raster-list-item-line--secondary {
    display: none;
}

.history-raster-timeline .history-raster-list-item.is-selected {
    --marker-size: var(--active-marker-size);
    color: #ffffff;
}

.history-raster-timeline .history-raster-list-item.is-selected::before { background: #4f9bff; }

.history-raster-timeline .history-raster-list-item.is-compare-a {
    --marker-size: var(--active-marker-size);
    color: #ffd991;
}

.history-raster-timeline .history-raster-list-item.is-compare-a::before,
.history-raster-timeline .history-raster-list-item.is-compare-b::before {
    display: grid;
    place-items: center;
    color: #07111c;
    font-size: 8px;
    font-weight: 800;
    line-height: 1;
}
.history-raster-timeline .history-raster-list-item.is-compare-a::before { content: "A"; background: #ffb84d; }

.history-raster-timeline .history-raster-list-item.is-compare-b {
    --marker-size: var(--active-marker-size);
    color: #a9ceff;
}
.history-raster-timeline .history-raster-list-item.is-compare-b::before { content: "B"; background: #4f9bff; }

.history-raster-timeline .history-raster-list-item.is-compare-a.is-compare-b {
    --marker-size: var(--active-marker-size);
}
.history-raster-timeline .history-raster-list-item.is-compare-a.is-compare-b::before { content: "A/B"; font-size: 6px; }

.history-raster-timeline .history-raster-toggle {
    min-width: 0;
    color: #e3edf7;
    font-size: 11px;
    white-space: nowrap;
}

.history-raster-timeline .history-raster-compare-btn,
.history-raster-timeline .history-raster-compare-close,
.history-raster-timeline .history-raster-zoom-btn,
.history-raster-timeline .history-raster-target {
    min-width: 32px;
    min-height: 34px;
    height: 34px;
    padding: 4px 12px;
    border: 1px solid rgba(143, 190, 255, 0.42);
    border-radius: 7px;
    background: rgba(47, 128, 237, 0.22);
    color: #edf5fc;
    font-size: 10px;
    font-weight: 600;
    cursor: pointer;
}

.history-raster-timeline .history-raster-target.is-active {
    border-color: #ffcf7a;
    background: rgba(255, 184, 77, 0.25);
    color: #fff5df;
}

.history-raster-timeline .history-raster-compare-btn:disabled {
    opacity: 0.45;
    cursor: default;
}

.history-raster-timeline .history-raster-compare-btn,
.history-raster-timeline .history-raster-zoom-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    white-space: nowrap;
}

.history-raster-timeline .history-raster-panel-close {
    width: 34px;
    min-width: 34px;
    height: 34px;
    min-height: 34px;
    padding: 0;
    font-size: 17px;
}

.history-raster-timeline .history-raster-compare-controls {
    display: grid;
    grid-template-columns: auto auto auto;
    align-items: center;
    gap: 6px;
    min-width: 0;
}

.history-raster-timeline .history-raster-select {
    display: none;
}

.history-raster-timeline .history-raster-panel-message {
    padding: 8px 10px 0;
    color: #c6d5e4;
    font-size: 11px;
}

.history-raster-timeline .history-raster-year-row[hidden],
.history-raster-timeline .history-raster-compare-controls[hidden] {
    display: none !important;
}

.map-swipe-label {
    position: absolute;
    bottom: 78px;
    max-width: min(170px, 42vw);
    padding: 5px 8px;
    overflow: hidden;
    border: 1px solid rgba(255, 255, 255, 0.18);
    border-radius: 7px;
    background: rgba(8, 18, 29, 0.92);
    color: #edf5fc;
    font-size: 11px;
    font-weight: 600;
    text-overflow: ellipsis;
    white-space: nowrap;
    box-shadow: 0 8px 18px rgba(0, 0, 0, 0.34);
    pointer-events: none;
}

.map-swipe-label--a {
    right: 9px;
    transform: translateX(-100%);
}

.map-swipe-label--b {
    left: 9px;
}

@media (max-width: 820px) {
    body.v2-shell { --map-left-offset: 0px; }

    body.v2-shell .history-raster-panel.history-raster-timeline,
    body.dxf-panel-open .history-raster-panel.history-raster-timeline,
    body.dxf-panel-open.sidebar-collapsed .history-raster-panel.history-raster-timeline {
        bottom: 10px;
        left: 10px;
        right: 10px;
        width: auto;
        max-width: none;
        height: 104px;
        min-height: 104px;
        max-height: 104px;
    }

    .history-raster-timeline .history-raster-panel-body {
        grid-template-rows: 1fr;
        gap: 2px;
    }

    .history-raster-timeline .history-raster-timeline-head {
        grid-template-columns: minmax(0, 1fr) auto auto 34px;
        grid-template-rows: 54px 34px;
        gap: 6px;
        min-height: 0;
    }

    .history-raster-timeline .history-raster-current-date { display: none; }
    .history-raster-timeline .history-raster-year-row { grid-column: 1; grid-row: 1; }
    .history-raster-timeline .history-raster-compare-btn { grid-column: 2; grid-row: 1; }
    .history-raster-timeline .history-raster-zoom-btn { grid-column: 3; grid-row: 1; }
    .history-raster-timeline .history-raster-panel-close { grid-column: 4; grid-row: 1; }
    .history-raster-timeline .history-raster-opacity-label { grid-column: 1; grid-row: 2; justify-self: end; }
    .history-raster-timeline .history-raster-opacity { grid-column: 2 / 4; grid-row: 2; width: 120px; min-width: 90px; max-width: 150px; justify-self: start; }
    .history-raster-timeline .history-raster-opacity-value { grid-column: 4; grid-row: 2; }

    .history-raster-timeline .history-raster-opacity-label-long { display: none; }
    .history-raster-timeline .history-raster-opacity-label-short { display: inline; }

    .history-raster-timeline .history-raster-year-row {
        grid-template-columns: 1fr;
        gap: 2px;
    }

    .history-raster-timeline .history-raster-list {
        justify-content: space-between;
    }

    .history-raster-timeline .history-raster-compare-btn { width: 34px; padding-inline: 0; font-size: 0; }
    .history-raster-timeline .history-raster-compare-btn::after { content: "A/B"; font-size: 9px; }
    .history-raster-timeline .history-raster-zoom-btn { width: 34px; padding-inline: 0; font-size: 0; }
    .history-raster-timeline .history-raster-zoom-btn::after { content: "\2197"; font-size: 14px; }

    .history-raster-timeline .history-raster-zoom-btn {
        display: inline-flex;
    }

    .history-raster-timeline .history-raster-compare-controls {
        grid-template-columns: auto auto auto;
    }

    .history-raster-timeline .history-raster-compare-close {
        grid-column: auto;
    }

    .map-swipe-label {
        bottom: 96px;
    }
}
.dxf-canvas-map-status { display: flex; flex-direction: column; gap: 4px; }

/* Warstwy UI nad CAD oraz brak tekstowego kursora w kontrolkach. */
.history-raster-panel,
.history-raster-panel button,
.history-raster-panel label,
.measurement-panel,
.measurement-panel button,
.measurement-panel label,
.dxf-info-panel button,
.dxf-info-panel label {
    user-select: none;
    caret-color: transparent;
}

.history-raster-panel input,
.history-raster-panel textarea,
.measurement-panel input,
.measurement-panel textarea,
.dxf-info-panel input,
.dxf-info-panel textarea,
[contenteditable="true"] {
    user-select: text;
    caret-color: auto;
}

.measurement-panel {
    z-index: 80;
    background: rgba(8, 18, 29, 0.985);
    pointer-events: auto;
}

.dxf-info-panel,
.duty-sidebar { z-index: 60; }
.tasklist-floating-dropdown {
    z-index: 10000;
    pointer-events: auto;
}
.dxf-canvas-map-progress { width: min(280px, 42vw); height: 4px; accent-color: #4f9bff; }
.app-topbar-title,
.duty-sidebar-section-title,
.dxf-info-panel-title,
.history-raster-panel-title,
.measurement-panel-title,
.map-notes-panel-title,
.map-note-form-title,
.tasklist-panel > summary,
.tasklist-section-head h3,
.tasklist-filter-section legend,
.tasklist-record-details h4 { font-weight: 400; }
.app-topbar-subtitle,
.topbar-search input,
.map-tool-btn,
.layer-switch-row p,
.basemap-option-label,
.basemap-current-label,
.dxf-info-search-input,
.dxf-info-list-item-line--primary,
.dxf-info-list-item-line--secondary,
.dxf-info-detail-title,
.dxf-info-zoom-btn,
.dxf-info-clear-btn,
.measurement-clear-btn,
.map-quick-btn,
.history-raster-list-item-line--primary,
.history-raster-toggle,
.history-raster-field-label,
.measurement-mode,
.history-raster-badge,
.map-runtime-status,
.map-zoom-debug,
.axis-map-status,
.axis-map-status #axis-map-status-name,
.tasklist-panel > summary small,
.tasklist-status-grid dt,
.tasklist-status-grid dd,
.tasklist-filter-grid label,
.tasklist-actions button,
.tasklist-results-summary,
.tasklist-results-table th,
.tasklist-record-details dt,
.tasklist-field-label,
.tasklist-multiselect-button,
.tasklist-show-panel,
.global-search-result-primary,
.map-tool-menu-item,
.map-notes-list-meta,
.map-note-btn,
.map-note-field,
.map-note-field-label,
.map-note-field-value { font-weight: 500; }

/* Ostateczna hierarchia typografii paneli. */
.duty-sidebar-section-title,
.dxf-info-panel-title,
.history-raster-panel-title,
.measurement-panel-title,
.tasklist-panel > summary,
.tasklist-section-head h3,
.tasklist-record-details h4 { font-weight: 500; }
