.plandom-ui {
    max-width: 42rem;
}

.plandom-ui.plandom-list-wide {
    max-width: 56rem;
}

.plandom-form .form-label {
    font-weight: 500;
}

.plandom-form fieldset {
    border: 0;
    padding: 0;
    margin: 0;
}

.plandom-filters .form-check-inline {
    margin-right: 0.5rem;
}

.plandom-filter-btns .btn-check:checked + .btn {
    background-color: var(--bs-primary);
    border-color: var(--bs-primary);
    color: #fff;
}

.plandom-filter-btns .btn {
    font-size: 0.8125rem;
    padding: 0.25rem 0.55rem;
}

.plandom-priority-fires .btn {
    padding: 0.2rem 0.45rem;
    line-height: 1;
}

.plandom-priority-fires .btn.active {
    background-color: var(--bs-warning);
    border-color: var(--bs-warning);
    color: #fff;
}

.plandom-fire-icon {
    display: inline-block;
    width: 0.95rem;
    height: 0.95rem;
    vertical-align: -0.1em;
    background-color: currentColor;
    opacity: 0.35;
    -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3E%3Cpath fill='%23000' d='M8 16c1.5-2 2.5-4.2 2.5-6.5C10.5 6 9 4.5 8 2 7 4.5 5.5 6 5.5 9.5 5.5 11.8 6.5 14 8 16z'/%3E%3C/svg%3E") center / contain no-repeat;
    mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3E%3Cpath fill='%23000' d='M8 16c1.5-2 2.5-4.2 2.5-6.5C10.5 6 9 4.5 8 2 7 4.5 5.5 6 5.5 9.5 5.5 11.8 6.5 14 8 16z'/%3E%3C/svg%3E") center / contain no-repeat;
}

.plandom-priority-fires .btn.active .plandom-fire-icon,
.plandom-fire-icon-lit {
    opacity: 1;
}

.plandom-priority-display {
    display: inline-flex;
    gap: 0.05rem;
    margin-right: 0.2rem;
    vertical-align: middle;
    color: #f59e0b;
}

.plandom-priority-display-sm .plandom-fire-icon {
    width: 0.75rem;
    height: 0.75rem;
}

.plandom-priority-picker-compact .plandom-priority-fires .btn {
    padding: 0.15rem 0.35rem;
}

.plandom-list-thumb {
    width: 2.5rem;
    height: 2.5rem;
    object-fit: cover;
    border-radius: 0.25rem;
    border: 1px solid #e5e7eb;
}

.plandom-task-activity-badge {
    display: inline-block;
    width: 0.55rem;
    height: 0.55rem;
    margin-left: 0.15rem;
    border-radius: 50%;
    background: #f59e0b;
    box-shadow: 0 0 0 2px #fff, 0 0 0 3px #fbbf24;
    vertical-align: middle;
    flex-shrink: 0;
}

.plandom-list-thumb-cell {
    width: 3rem;
    padding-right: 0.25rem !important;
}

.plandom-status-cell {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    white-space: nowrap;
}

.plandom-status-dot {
    width: 0.55rem;
    height: 0.55rem;
    border-radius: 50%;
    flex-shrink: 0;
}

.plandom-dot-nowe { background-color: #ea580c; }
.plandom-dot-przypisane-nowe { background-color: #ca8a04; }
.plandom-dot-rozpoczete { background-color: #16a34a; }
.plandom-dot-zakonczone { background-color: #6b7280; }
.plandom-dot-anulowane { background-color: #9ca3af; }
.plandom-dot-default { background-color: #6b7280; }

.plandom-badge-nowe { background-color: #ffedd5; color: #9a3412; }
.plandom-badge-przypisane-nowe { background-color: #fef9c3; color: #854d0e; }
.plandom-badge-rozpoczete { background-color: #dcfce7; color: #166534; }
.plandom-badge-zakonczone { background-color: #f3f4f6; color: #4b5563; }
.plandom-badge-anulowane { background-color: #f9fafb; color: #6b7280; }

.plandom-table tbody tr.plandom-status-nowe td { background-color: #fff7ed; }
.plandom-table tbody tr.plandom-status-przypisane-nowe td { background-color: #fefce8; }
.plandom-table tbody tr.plandom-status-rozpoczete td { background-color: #f0fdf4; }
.plandom-table tbody tr.plandom-status-zakonczone td { color: #4b5563; }
.plandom-table tbody tr.plandom-status-anulowane td {
    background-color: #f9fafb;
    color: #6b7280;
    text-decoration: line-through;
}

.card.plandom-status-nowe { border-left: 4px solid #ea580c; }
.card.plandom-status-przypisane-nowe { border-left: 4px solid #ca8a04; }
.card.plandom-status-rozpoczete { border-left: 4px solid #16a34a; }
.card.plandom-status-zakonczone { border-left: 4px solid #9ca3af; }
.card.plandom-status-anulowane { opacity: 0.85; text-decoration: line-through; }

.plandom-description {
    white-space: pre-wrap;
}

.plandom-home {
    max-width: 56rem;
}

.plandom-scheme-tile {
    transition: box-shadow 0.15s ease, transform 0.15s ease;
    border: 1px solid #e5e7eb;
}

.plandom-scheme-tile:hover {
    box-shadow: 0 0.25rem 0.75rem rgba(0, 0, 0, 0.08);
    transform: translateY(-2px);
}

.plandom-scheme-empty {
    border-style: dashed;
    background-color: #f9fafb;
}

.scheme-save-block .js-scheme-fields {
    display: none;
}

.scheme-save-block:has(.js-save-scheme-toggle:checked) .js-scheme-fields {
    display: block;
}

.plandom-ui.plandom-form-compact {
    max-width: 48rem;
}

.plandom-form-compact .form-check-sm {
    min-height: 1.35rem;
    margin-bottom: 0.15rem;
}

.plandom-form-compact .form-check-sm .form-check-label {
    font-size: 0.9rem;
}

.plandom-form-compact fieldset legend {
    margin-bottom: 0.35rem;
}

/* Formularz mobilny — podstawowe pola bez przewijania */
.plandom-ui.plandom-form-mobile {
    max-width: 100%;
}

.plandom-form-mobile .form-label-sm {
    font-size: 0.75rem;
    font-weight: 600;
    color: #4b5563;
}

.plandom-user-chips {
    display: flex;
    flex-wrap: wrap;
    gap: 0.25rem;
    max-height: 4.5rem;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    padding: 0.15rem 0;
}

.plandom-user-chip {
    display: inline-flex;
    align-items: center;
    margin: 0;
    cursor: pointer;
}

.plandom-user-chip input {
    position: absolute;
    opacity: 0;
    width: 0;
    height: 0;
}

.plandom-user-chip span {
    display: inline-block;
    font-size: 0.7rem;
    line-height: 1.2;
    padding: 0.2rem 0.45rem;
    border-radius: 999px;
    border: 1px solid #d1d5db;
    background: #f9fafb;
    color: #374151;
    white-space: nowrap;
}

.plandom-user-chip input:checked + span {
    background: #dbeafe;
    border-color: #3b82f6;
    color: #1d4ed8;
}

.plandom-user-chip-readonly {
    display: inline-flex;
    align-items: center;
    cursor: default;
}

.plandom-user-chip-readonly span {
    display: inline-block;
    font-size: 0.7rem;
    line-height: 1.2;
    padding: 0.2rem 0.45rem;
    border-radius: 999px;
    border: 1px dashed #9ca3af;
    background: #f3f4f6;
    color: #6b7280;
    white-space: nowrap;
}

.plandom-participant-self {
    padding: 0.15rem 0.5rem;
    border-radius: 0.375rem;
    background: #f3f4f6;
    border: 1px dashed #d1d5db;
    display: inline-block;
}

.plandom-form-extras summary {
    cursor: pointer;
    user-select: none;
    padding: 0.25rem 0;
}

.plandom-form-extras[open] summary {
    margin-bottom: 0.25rem;
}

.plandom-form-mobile-actions {
    display: flex;
    gap: 0.5rem;
    padding-top: 0.5rem;
    border-top: 1px solid #e5e7eb;
}

.plandom-photo-pick label.btn {
    cursor: pointer;
}

/* Podgląd zadania — mobilny */
.plandom-ui.plandom-task-view-mobile {
    max-width: 100%;
}

.plandom-task-description-box {
    background: #fffbeb;
    border: 1px solid #fde68a;
    border-left: 4px solid #f59e0b;
    border-radius: 0.5rem;
    padding: 0.65rem 0.75rem;
}

.plandom-task-description-label {
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.03em;
    color: #b45309;
    margin-bottom: 0.35rem;
}

.plandom-task-photo-scroll {
    display: flex;
    gap: 0.5rem;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    padding-bottom: 0.25rem;
}

.plandom-task-photo-thumb {
    flex: 0 0 5.5rem;
    display: block;
}

.plandom-task-photo-thumb img {
    width: 5.5rem;
    height: 5.5rem;
    object-fit: cover;
    border-radius: 0.375rem;
    border: 1px solid #e5e7eb;
}

.plandom-task-extras summary,
.plandom-filter-details summary {
    cursor: pointer;
    user-select: none;
}

@media (min-width: 576px) {
    .plandom-ui.plandom-task-view-mobile {
        max-width: 40rem;
    }

    .plandom-task-photo-scroll {
        flex-wrap: wrap;
        overflow: visible;
    }
}

body.plandom-body-form-mobile {
    padding-bottom: env(safe-area-inset-bottom, 0);
}

body.plandom-body-form-mobile .navbar {
    padding-top: 0.35rem;
    padding-bottom: 0.35rem;
    margin-bottom: 0.5rem !important;
}

body.plandom-body-form-mobile .navbar-brand {
    font-size: 1rem;
}

body.plandom-body-form-mobile .navbar .nav-link {
    font-size: 0.8rem;
    padding: 0.25rem 0.5rem;
}

body.plandom-body-form-mobile main.container {
    padding-left: 0.65rem;
    padding-right: 0.65rem;
    padding-bottom: 1rem;
    max-width: 100%;
}

@media (max-width: 991.98px) {
    .navbar-collapse .navbar-nav {
        padding-top: 0.5rem;
        padding-bottom: 0.25rem;
    }

    .navbar-collapse .navbar-nav .nav-link {
        padding-left: 0;
        padding-right: 0;
    }
}

@media (max-width: 575.98px) {
    .plandom-form-mobile-actions {
        position: sticky;
        bottom: 0;
        z-index: 10;
        background: #fff;
        margin: 0 -0.65rem;
        padding: 0.5rem 0.65rem calc(0.5rem + env(safe-area-inset-bottom, 0));
        box-shadow: 0 -2px 8px rgba(0, 0, 0, 0.06);
    }

    .plandom-user-chips {
        max-height: 3.6rem;
    }
}

@media (min-width: 576px) {
    .plandom-ui.plandom-form-mobile {
        max-width: 36rem;
    }

    .plandom-user-chips {
        max-height: none;
        overflow: visible;
    }
}
