/* Единый недельный план: «рабочая доска со стикерами» в визуальном языке PrimeBPM. */
.weekly-plan {
    --weekly-border: var(--color-border);
    --weekly-muted: var(--color-text-secondary);
    --weekly-surface: var(--color-surface);
    padding: 24px 8px 32px;
    background: var(--color-bg-app);
    color: var(--color-text);
}

@media (min-width: 769px) {
    #tab-weekly-plan.tab-content {
        width: 100%;
        max-width: 1800px;
        padding-top: 0;
        padding-right: 32px;
        padding-bottom: 0;
        padding-left: 32px;
    }

    #tab-weekly-plan .weekly-plan {
        padding-top: 12px;
    }
}

.weekly-plan-toolbar,
.weekly-plan-week-nav,
.weekly-plan-toolbar-actions {
    display: flex;
    align-items: center;
}

.weekly-plan-toolbar {
    justify-content: space-between;
    gap: 16px;
    margin-bottom: 16px;
}

.weekly-plan-week-nav,
.weekly-plan-toolbar-actions {
    gap: 8px;
}

.weekly-plan-range {
    margin-left: 8px;
    font-size: 15px;
    font-weight: 650;
    letter-spacing: -0.01em;
    white-space: nowrap;
}

.weekly-plan-icon-btn,
.weekly-plan-today-btn,
.weekly-plan-add-btn,
.weekly-plan-cancel,
.weekly-plan-submit,
.weekly-plan-close {
    min-height: 38px;
    border: 1px solid var(--weekly-border);
    border-radius: var(--radius-md);
    background: var(--weekly-surface);
    color: var(--color-text-strong);
    font: inherit;
    cursor: pointer;
    transition: background-color .16s ease, border-color .16s ease, transform .16s ease;
}

.weekly-plan-icon-btn {
    width: 38px;
    padding: 0;
    font-size: 17px;
}

.weekly-plan-today-btn,
.weekly-plan-cancel {
    padding: 0 13px;
    font-size: 13px;
    font-weight: 600;
}

.weekly-plan-add-btn,
.weekly-plan-submit {
    padding: 0 15px;
    border-color: var(--color-action-primary);
    background: var(--color-action-primary);
    color: var(--color-action-primary-text);
    font-size: 13px;
    font-weight: 650;
}

.weekly-plan-add-btn {
    min-height: 34px;
    padding: 0 12px;
    border-radius: 8px;
    font-size: 12px;
    white-space: nowrap;
}

.weekly-plan-icon-btn:hover,
.weekly-plan-today-btn:hover,
.weekly-plan-cancel:hover {
    background: var(--color-bg-subtle);
}

.weekly-plan-add-btn:hover,
.weekly-plan-submit:hover {
    transform: translateY(-1px);
}

.weekly-plan button:focus-visible,
.weekly-plan select:focus-visible,
.weekly-plan input:focus-visible,
.weekly-plan textarea:focus-visible {
    outline: 2px solid var(--color-border-focus);
    outline-offset: 2px;
}

.weekly-plan-department {
    display: flex;
    align-items: center;
    gap: 7px;
    color: var(--weekly-muted);
    font-size: 11.5px;
}

.weekly-plan-field select,
.weekly-plan-field input,
.weekly-plan-field textarea {
    width: 100%;
    min-height: 40px;
    border: 1px solid var(--weekly-border);
    border-radius: var(--radius-md);
    background: var(--weekly-surface);
    color: inherit;
    padding: 0 11px;
    font: inherit;
}

.weekly-plan-department .system-select {
    width: min(220px, 24vw);
    min-width: 180px;
    max-width: 220px;
    min-height: 32px;
    padding: 5px 30px 5px 10px;
    background-color: var(--weekly-surface);
    color: var(--color-text);
    font-size: 11.5px;
}

.weekly-plan-summary {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    border: 1px solid var(--weekly-border);
    border-radius: var(--radius-lg);
    background: var(--weekly-surface);
    box-shadow: var(--shadow-surface);
    overflow: hidden;
    margin-bottom: 12px;
}

.weekly-plan-summary article {
    min-width: 0;
    padding: 10px 14px;
}

.weekly-plan-summary article + article {
    border-left: 1px solid var(--weekly-border);
}

.weekly-plan-summary span,
.weekly-plan-summary small {
    display: block;
    color: var(--weekly-muted);
}

.weekly-plan-summary span {
    margin-bottom: 4px;
    font-size: 10px;
    font-weight: 650;
    letter-spacing: .06em;
    text-transform: uppercase;
}

.weekly-plan-summary strong {
    display: block;
    font-size: 20px;
    line-height: 1;
    letter-spacing: -.04em;
}

.weekly-plan-summary small {
    margin-top: 4px;
    font-size: 10px;
}

.weekly-plan-status {
    min-height: 20px;
    margin: -4px 0 8px;
    color: var(--weekly-muted);
    font-size: 12px;
}

.weekly-plan-status.is-error {
    color: var(--color-danger);
}

.weekly-plan-board-shell {
    max-width: 100%;
    overflow: auto;
    overscroll-behavior-x: contain;
    border: 1px solid var(--weekly-border);
    border-radius: var(--radius-xl);
    background: var(--weekly-surface);
    box-shadow: var(--shadow-surface);
}

.weekly-plan-board {
    display: grid;
    grid-template-columns: 220px repeat(5, minmax(190px, 1fr));
    min-width: 1170px;
}

.weekly-plan-member,
.weekly-plan-member-days {
    display: contents;
}

.weekly-plan-corner,
.weekly-plan-day-head,
.weekly-plan-person,
.weekly-plan-cell {
    border-right: 1px solid var(--weekly-border);
    border-bottom: 1px solid var(--weekly-border);
}

.weekly-plan-corner,
.weekly-plan-day-head {
    position: sticky;
    top: 0;
    z-index: 3;
    min-height: 62px;
    padding: 12px 14px;
    background: var(--color-bg-subtle);
}

.weekly-plan-corner {
    left: 0;
    z-index: 5;
    display: flex;
    align-items: center;
    color: var(--weekly-muted);
    font-size: 11px;
    font-weight: 650;
    letter-spacing: .07em;
    text-transform: uppercase;
}

.weekly-plan-day-head {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 10px;
}

.weekly-plan-day-head strong {
    font-size: 13px;
}

.weekly-plan-day-head span {
    color: var(--weekly-muted);
    font-size: 12px;
}

.weekly-plan-day-head.is-today {
    box-shadow: inset 0 -2px var(--color-primary);
}

.weekly-plan-person {
    position: sticky;
    left: 0;
    z-index: 2;
    min-height: 150px;
    padding: 14px;
    background: var(--weekly-surface);
}

.weekly-plan-person-name {
    display: block;
    font-size: 13px;
    font-weight: 650;
    line-height: 1.35;
}

.weekly-plan-person-role {
    display: block;
    min-height: 32px;
    margin-top: 3px;
    color: var(--weekly-muted);
    font-size: 11px;
    line-height: 1.35;
}

.weekly-plan-person-kpi {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    margin-top: 12px;
    padding: 5px 8px;
    border: 1px solid var(--weekly-border);
    border-radius: 999px;
    background: var(--weekly-surface);
    font-size: 11px;
    font-weight: 650;
}

.weekly-plan-cell {
    position: relative;
    min-height: var(
        --weekly-content-height,
        max(150px, calc(var(--weekly-lanes, 1) * 92px + 48px))
    );
    padding: 9px;
    background: var(--weekly-surface);
    overflow: visible;
}

.weekly-plan-cell.is-today {
    background: var(--color-primary-25);
}

.weekly-plan-cell.is-dragover {
    background: var(--color-primary-50);
    box-shadow: inset 0 0 0 2px var(--color-primary);
}

.weekly-plan-card {
    --weekly-card-accent: var(--color-primary);
    --weekly-card-background: var(--color-primary-25);
    position: relative;
    margin-bottom: 6px;
    padding: 8px 8px 7px 26px;
    border: 1px solid var(--weekly-border);
    border-left: 3px solid var(--weekly-card-accent);
    border-radius: var(--radius-md);
    background: var(--weekly-card-background);
    box-shadow: none;
    color: var(--color-text);
}

.weekly-plan-card.is-span-card {
    position: absolute;
    z-index: 2;
    top: var(--weekly-lane-top, calc(9px + var(--weekly-lane, 0) * 92px));
    left: 9px;
    width: calc(var(--weekly-span, 1) * 100% - 18px);
    min-height: 84px;
    margin: 0;
}

.weekly-plan-card.is-span-card:hover,
.weekly-plan-card.is-span-card:focus-within,
.weekly-plan-card.is-resizing {
    z-index: 4;
}

.weekly-plan-card[data-weekly-drag] {
    cursor: grab;
    user-select: none;
}

.weekly-plan-card[data-weekly-drag].is-dragging {
    cursor: grabbing;
}

.weekly-plan-card.is-unplanned {
    --weekly-card-accent: var(--color-danger);
    --weekly-card-background: var(--color-danger-background);
}

.weekly-plan-card.is-done {
    opacity: .68;
}

.weekly-plan-card.is-dragging {
    opacity: .55;
}

.weekly-plan-card.is-resizing {
    box-shadow: 0 0 0 2px var(--color-primary-200);
}

.weekly-plan-resize-handle {
    display: block;
    position: absolute;
    z-index: 5;
    top: 7px;
    bottom: 7px;
    width: 12px;
    padding: 0;
    border: 0;
    border-radius: 6px;
    background: transparent;
    cursor: ew-resize;
    opacity: 0;
}

.weekly-plan-resize-handle::after {
    position: absolute;
    top: 50%;
    left: 50%;
    width: 3px;
    height: 24px;
    border-radius: 999px;
    background: var(--color-primary);
    content: "";
    transform: translate(-50%, -50%);
}

.weekly-plan-resize-handle.is-start { left: -6px; }
.weekly-plan-resize-handle.is-end { right: -6px; }

.weekly-plan-card:hover .weekly-plan-resize-handle,
.weekly-plan-resize-handle:focus-visible,
.weekly-plan-card.is-resizing .weekly-plan-resize-handle {
    opacity: 1;
}

.weekly-plan-resize-handle:focus-visible {
    outline: 2px solid var(--color-primary);
    outline-offset: 2px;
}

.weekly-plan-drag-handle {
    display: flex;
    position: absolute;
    top: 4px;
    left: 3px;
    width: 22px;
    height: 28px;
    align-items: center;
    justify-content: center;
    border: 0;
    background: transparent;
    color: var(--weekly-muted);
    cursor: grab;
    font-size: 12px;
    line-height: 28px;
    padding: 0;
    touch-action: none;
}

.weekly-plan-drag-handle:active {
    cursor: grabbing;
}

.weekly-plan-member-toggle,
.weekly-plan-card-move {
    display: none;
}

.weekly-plan-card-title-row {
    display: flex;
    align-items: flex-start;
    gap: 6px;
}

.weekly-plan-card-title {
    display: block;
    flex: 1 1 auto;
    min-width: 0;
    border: 0;
    background: transparent;
    color: inherit;
    padding: 0;
    text-align: left;
    font: inherit;
    font-size: 12px;
    font-weight: 650;
    line-height: 1.35;
    cursor: pointer;
}

.weekly-plan-card-edit,
.weekly-plan-card-delete {
    flex: 0 0 22px;
    width: 22px;
    min-height: 22px;
    margin: -4px -4px 0 0;
    padding: 0;
    border: 0;
    border-radius: var(--radius-sm);
    background: transparent;
    color: var(--weekly-muted);
    cursor: pointer;
    opacity: .72;
}

.weekly-plan-card-edit:hover {
    background: var(--color-surface-hover);
    color: var(--color-text);
    opacity: 1;
}

.weekly-plan-card-delete:hover {
    background: var(--color-danger-background);
    color: var(--color-danger);
    opacity: 1;
}

.weekly-plan-card-project {
    display: flex;
    align-items: baseline;
    gap: 5px;
    min-width: 0;
    margin-top: 3px;
    color: var(--color-text-secondary);
    font-size: 10px;
    line-height: 1.3;
}

.weekly-plan-card-project span {
    flex: 0 0 auto;
    color: var(--color-text-muted);
}

.weekly-plan-card-project strong {
    min-width: 0;
    overflow: hidden;
    color: var(--color-text-strong);
    font-weight: 600;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.weekly-plan-card-meta {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 5px;
    margin-top: 4px;
    color: var(--color-text-secondary);
    font-size: 10px;
}

.weekly-plan-card-meta span {
    padding: 1px 5px;
    border-radius: 999px;
    background: var(--color-surface);
}

.weekly-plan-card-range {
    color: var(--color-text-secondary);
    font-variant-numeric: tabular-nums;
    white-space: nowrap;
}

.weekly-plan-status-trigger.status-pill {
    max-width: 100%;
    min-height: 20px;
    gap: 4px;
    padding: 2px 7px 2px 6px;
    border: 1px solid transparent;
    font-size: 9.5px;
    font-weight: 600;
    line-height: 1;
    white-space: nowrap;
}

.weekly-plan-status-trigger.status-pill::before {
    width: 5px;
    height: 5px;
}

button.weekly-plan-status-trigger:hover {
    border-color: var(--weekly-border);
}

button.weekly-plan-status-trigger:disabled {
    cursor: wait;
    opacity: .6;
}

.weekly-plan-status-popover {
    min-width: 156px;
}

.weekly-plan-status-popover .ui-popover-item {
    min-height: 32px;
    padding: 7px 8px;
    font-size: 12px;
}

.weekly-plan-card-outcome {
    min-height: 22px;
    padding: 1px 7px;
    border: 1px solid var(--weekly-border);
    border-radius: 999px;
    background: transparent;
    color: var(--color-text-secondary);
    font: inherit;
    font-size: 10px;
    cursor: pointer;
}

.weekly-plan-card-outcome:hover {
    border-color: var(--color-border-strong);
    background: var(--color-surface-hover);
    color: var(--color-text);
}

.weekly-plan-card-outcome.is-complete {
    border-color: color-mix(in srgb, var(--color-success) 34%, var(--weekly-border));
    color: var(--color-success);
}

.weekly-plan-card-reason {
    margin: 4px 0 0;
    color: var(--color-text-secondary);
    font-size: 10px;
    line-height: 1.35;
}

.weekly-plan-rename {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 28px 28px;
    gap: 4px;
}

.weekly-plan-rename[hidden] {
    display: none;
}

.weekly-plan-rename input {
    min-width: 0;
    min-height: 30px;
    padding: 5px 7px;
    border: 1px solid var(--color-border-focus);
    border-radius: var(--radius-sm);
    background: var(--color-surface);
    color: var(--color-text);
    font: inherit;
    font-size: 12px;
}

.weekly-plan-rename button {
    min-height: 28px;
    padding: 0;
    border: 1px solid var(--weekly-border);
    border-radius: var(--radius-sm);
    background: var(--color-surface);
    color: var(--color-text-strong);
    cursor: pointer;
}

.weekly-plan-rename-error {
    grid-column: 1 / -1;
    min-height: 0;
    color: var(--color-danger);
    font-size: 10px;
}

.weekly-plan-cell-add {
    position: absolute;
    right: 9px;
    bottom: 6px;
    left: 9px;
    width: auto;
    min-height: 30px;
    border: 1px dashed transparent;
    border-radius: 8px;
    background: transparent;
    color: transparent;
    font: inherit;
    font-size: 11px;
    cursor: pointer;
}

.weekly-plan-move-fields {
    grid-template-columns: repeat(2, minmax(0, 1fr));
}

.weekly-plan-move-assignee {
    grid-column: 1 / -1;
}

.weekly-plan-cell:hover .weekly-plan-cell-add,
.weekly-plan-cell-add:focus-visible {
    border-color: var(--weekly-border);
    color: var(--weekly-muted);
}

.weekly-plan-empty {
    grid-column: 1 / -1;
    padding: 48px 24px;
    color: var(--weekly-muted);
    text-align: center;
}

.weekly-plan-modal {
    position: fixed;
    inset: 0;
    z-index: 2200;
    display: grid;
    place-items: center;
    padding: 20px;
    background: var(--scrim, var(--color-overlay));
    backdrop-filter: none;
    -webkit-backdrop-filter: none;
}

.weekly-plan-modal[hidden] {
    display: none;
}

.weekly-plan-modal-card {
    width: min(570px, 100%);
    max-height: calc(100dvh - 40px);
    overflow: auto;
    border: 1px solid var(--weekly-border);
    border-radius: 16px;
    background-color: var(--color-surface);
    background-image: none;
    opacity: 1;
    isolation: isolate;
    box-shadow: var(--shadow-overlay, var(--shadow-raised));
    padding: 20px;
}

.weekly-plan-modal-head {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 16px;
    margin-bottom: 18px;
}

.weekly-plan-eyebrow {
    display: block;
    margin-bottom: 3px;
    color: var(--weekly-muted);
    font-size: 10px;
    font-weight: 700;
    letter-spacing: .08em;
    text-transform: uppercase;
}

.weekly-plan-modal-head h3 {
    margin: 0;
    font-size: 21px;
    letter-spacing: -.03em;
}

.weekly-plan-close {
    min-height: 34px;
    width: 34px;
    padding: 0;
    font-size: 22px;
}

.weekly-plan-field {
    display: block;
    margin-bottom: 14px;
}

.weekly-plan-field > span,
.weekly-plan-kind legend {
    display: block;
    margin-bottom: 6px;
    color: var(--weekly-muted);
    font-size: 11px;
    font-weight: 650;
}

.weekly-plan-field textarea {
    min-height: 82px;
    padding-top: 10px;
    resize: vertical;
}

.weekly-plan-form-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 12px;
}

.weekly-plan-project-hint {
    min-height: 16px;
    margin: -7px 0 13px;
    color: var(--weekly-muted);
    font-size: 11px;
    line-height: 1.4;
}

.weekly-plan-kind {
    min-width: 0;
    margin: 0 0 14px;
    padding: 0;
    border: 0;
}

.weekly-plan-kind label {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    margin-right: 12px;
    font-size: 12px;
}

.weekly-plan-form-error {
    min-height: 20px;
    color: var(--color-danger);
    font-size: 12px;
}

.weekly-plan-modal-actions {
    display: flex;
    justify-content: flex-end;
    gap: 8px;
    padding-top: 6px;
}

.weekly-plan-digest-card {
    width: min(720px, 100%);
}

.weekly-plan-move-card {
    width: min(520px, 100%);
}

.weekly-plan-digest-task {
    margin: -6px 0 8px;
    color: var(--color-text);
    font-size: 15px;
    font-weight: 650;
    line-height: 1.4;
}

.weekly-plan-digest-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-bottom: 18px;
}

.weekly-plan-digest-meta span {
    padding: 4px 8px;
    border: 1px solid var(--weekly-border);
    border-radius: 999px;
    color: var(--weekly-muted);
    font-size: 10px;
    line-height: 1.2;
}

.weekly-plan-digest-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 12px;
}

.weekly-plan-digest-field {
    display: flex;
    min-width: 0;
    padding: 12px;
    border: 1px solid var(--weekly-border);
    border-top: 3px solid var(--color-border-strong);
    border-radius: 12px;
    background: var(--color-surface-subtle, var(--color-bg-faint));
    flex-direction: column;
    gap: 10px;
}

.weekly-plan-digest-field.is-success {
    border-top-color: var(--color-success);
}

.weekly-plan-digest-field.is-issue {
    border-top-color: var(--color-danger);
}

.weekly-plan-digest-field > span {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.weekly-plan-digest-field strong {
    color: var(--color-text);
    font-size: 12px;
    font-weight: 700;
}

.weekly-plan-digest-field small,
.weekly-plan-digest-hint {
    color: var(--weekly-muted);
    font-size: 10px;
    line-height: 1.4;
}

.weekly-plan-digest-field textarea {
    width: 100%;
    min-height: 142px;
    padding: 10px;
    border: 1px solid var(--weekly-border);
    border-radius: 8px;
    background: var(--color-surface);
    color: var(--color-text);
    font: inherit;
    font-size: 12px;
    line-height: 1.45;
    resize: vertical;
}

.weekly-plan-digest-field textarea:focus-visible {
    border-color: var(--color-border-focus);
    outline: 2px solid color-mix(in srgb, var(--color-primary) 24%, transparent);
    outline-offset: 1px;
}

.weekly-plan-digest-hint {
    margin: 10px 0 0;
}

.weekly-plan-cancel,
.weekly-plan-submit {
    min-width: 104px;
}

@media (max-width: 768px) {
    #tab-weekly-plan.tab-content {
        width: 100%;
        max-width: 100%;
        padding: 0;
        overflow-x: clip;
    }

    .weekly-plan {
        width: 100%;
        max-width: 100%;
        padding: 10px 10px calc(96px + env(safe-area-inset-bottom));
        overflow-x: clip;
    }

    .weekly-plan-toolbar {
        align-items: stretch;
        flex-direction: column;
        gap: 10px;
        margin-bottom: 10px;
    }

    .weekly-plan-week-nav {
        display: grid;
        grid-template-columns: 44px minmax(0, 1fr) 44px;
        gap: 8px;
    }

    .weekly-plan-icon-btn {
        width: 44px;
        min-height: 44px;
    }

    .weekly-plan-today-btn {
        min-height: 44px;
        padding: 0 10px;
    }

    .weekly-plan-range {
        grid-column: 1 / -1;
        margin: 0;
        padding: 2px 0 0;
        font-size: 14px;
        text-align: center;
        white-space: normal;
    }

    .weekly-plan-toolbar-actions {
        display: grid;
        grid-template-columns: minmax(0, 1fr) auto;
        align-items: flex-end;
        gap: 8px;
    }

    .weekly-plan-department {
        min-width: 0;
        align-items: stretch;
        flex-direction: column;
        gap: 4px;
    }

    .weekly-plan-department .system-select {
        width: 100%;
        min-width: 0;
        max-width: none;
        min-height: 44px;
    }

    .weekly-plan-add-btn {
        min-height: 44px;
        padding: 0 14px;
        font-size: 12px;
    }

    .weekly-plan-summary {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        margin-bottom: 10px;
    }

    .weekly-plan-summary article {
        padding: 10px 11px;
    }

    .weekly-plan-summary article + article {
        border-left: 1px solid var(--weekly-border);
    }

    .weekly-plan-summary article:nth-child(3) {
        grid-column: 1 / -1;
        border-top: 1px solid var(--weekly-border);
        border-left: 0;
    }

    .weekly-plan-summary small {
        font-size: 9.5px;
        line-height: 1.35;
    }

    .weekly-plan-status {
        margin: -2px 0 6px;
    }

    .weekly-plan-board-shell {
        overflow: visible;
        border: 0;
        border-radius: 0;
        background: transparent;
        box-shadow: none;
    }

    .weekly-plan-board {
        display: block;
        min-width: 0;
    }

    .weekly-plan-corner,
    .weekly-plan-day-head {
        display: none;
    }

    .weekly-plan-member,
    .weekly-plan-member-days {
        display: block;
    }

    .weekly-plan-member {
        margin-bottom: 10px;
        border: 1px solid var(--weekly-border);
        border-radius: 14px;
        background: var(--weekly-surface);
        box-shadow: var(--shadow-surface);
        overflow: hidden;
    }

    .weekly-plan-person {
        position: static;
        z-index: auto;
        display: grid;
        grid-template-columns: minmax(0, 1fr) auto 44px;
        grid-template-rows: auto auto;
        min-height: 0;
        padding: 12px;
        border: 0;
        background: var(--color-bg-subtle);
    }

    .weekly-plan-person-name {
        grid-column: 1;
        grid-row: 1;
        font-size: 14px;
    }

    .weekly-plan-person-role {
        grid-column: 1;
        grid-row: 2;
        min-height: 0;
        margin-top: 2px;
    }

    .weekly-plan-person-kpi {
        grid-column: 2;
        grid-row: 1 / 3;
        align-self: center;
        margin: 0 4px 0 8px;
        white-space: nowrap;
    }

    .weekly-plan-member-toggle {
        grid-column: 3;
        grid-row: 1 / 3;
        display: grid;
        width: 44px;
        min-height: 44px;
        place-items: center;
        align-self: center;
        padding: 0;
        border: 0;
        border-radius: 10px;
        background: transparent;
        color: var(--weekly-muted);
        font: inherit;
        font-size: 20px;
        cursor: pointer;
    }

    .weekly-plan-member-toggle span {
        transition: transform .18s ease;
    }

    .weekly-plan-member.is-collapsed .weekly-plan-member-toggle span {
        transform: rotate(-90deg);
    }

    .weekly-plan-member.is-collapsed .weekly-plan-member-days {
        display: none;
    }

    .weekly-plan-cell {
        position: static;
        min-height: 58px;
        padding: 10px;
        border-right: 0;
        border-bottom: 1px solid var(--weekly-border);
        background: var(--weekly-surface);
        overflow: hidden;
    }

    .weekly-plan-cell:last-child {
        border-bottom: 0;
    }

    .weekly-plan-cell::before {
        display: block;
        margin-bottom: 8px;
        color: var(--weekly-muted);
        content: attr(data-weekly-day-label);
        font-size: 10px;
        font-weight: 700;
        letter-spacing: .06em;
        text-transform: uppercase;
    }

    .weekly-plan-cell.is-today::before {
        color: var(--color-primary);
    }

    .weekly-plan-card,
    .weekly-plan-card.is-span-card {
        position: relative;
        top: auto;
        left: auto;
        width: auto;
        min-height: 0;
        margin-bottom: 8px;
        padding: 11px 10px 10px;
        border-radius: 10px;
    }

    .weekly-plan-drag-handle {
        display: none;
    }

    .weekly-plan-resize-handle {
        display: none;
    }

    .weekly-plan-card-title {
        min-height: 40px;
        font-size: 14px;
        line-height: 1.35;
    }

    .weekly-plan-card-edit,
    .weekly-plan-card-delete {
        flex-basis: 40px;
        width: 40px;
        min-height: 40px;
        margin: -6px -4px 0 0;
        font-size: 18px;
        opacity: 1;
    }

    .weekly-plan-card-project {
        margin-top: 5px;
        font-size: 11px;
    }

    .weekly-plan-card-meta {
        gap: 7px;
        margin-top: 8px;
    }

    .weekly-plan-status-trigger.status-pill,
    .weekly-plan-card-outcome,
    .weekly-plan-card-move {
        min-height: 36px;
        padding: 7px 10px;
        font-size: 11px;
    }

    .weekly-plan-card-move {
        display: inline-flex;
        align-items: center;
        gap: 4px;
        border: 1px solid var(--weekly-border);
        border-radius: 999px;
        background: transparent;
        color: var(--color-text-secondary);
        font: inherit;
        cursor: pointer;
    }

    .weekly-plan-cell-add {
        position: static;
        width: 100%;
        min-height: 44px;
        border-color: var(--weekly-border);
        color: var(--weekly-muted);
    }

    .weekly-plan-rename {
        grid-template-columns: minmax(0, 1fr) 44px 44px;
        gap: 6px;
    }

    .weekly-plan-rename input,
    .weekly-plan-rename button {
        min-height: 44px;
    }

    .weekly-plan-form-grid {
        grid-template-columns: 1fr;
        gap: 0;
    }

    .weekly-plan-digest-grid {
        grid-template-columns: 1fr;
    }

    .weekly-plan-digest-field textarea {
        min-height: 112px;
    }

    .weekly-plan-modal {
        align-items: end;
        padding: 0;
    }

    .weekly-plan-modal-card {
        width: 100%;
        max-height: min(88dvh, 760px);
        border-radius: 18px 18px 0 0;
        padding: 18px 16px calc(16px + env(safe-area-inset-bottom));
    }

    .weekly-plan-modal-head {
        margin-bottom: 14px;
    }

    .weekly-plan-close {
        width: 44px;
        min-height: 44px;
    }

    .weekly-plan-field select,
    .weekly-plan-field input {
        min-height: 48px;
    }

    .weekly-plan-kind label {
        min-height: 44px;
        margin-right: 16px;
    }

    .weekly-plan-modal-actions {
        position: sticky;
        bottom: calc(-16px - env(safe-area-inset-bottom));
        z-index: 2;
        margin: 4px -16px 0;
        padding: 12px 16px calc(12px + env(safe-area-inset-bottom));
        border-top: 1px solid var(--weekly-border);
        background: var(--weekly-surface);
    }

    .weekly-plan-cancel,
    .weekly-plan-submit {
        flex: 1 1 0;
        min-width: 0;
        min-height: 46px;
    }
}

[data-theme="dark"] .weekly-plan-card,
.dark-theme .weekly-plan-card {
    color: var(--color-text);
}

@media (prefers-reduced-motion: reduce) {
    .weekly-plan * {
        scroll-behavior: auto !important;
        transition-duration: .01ms !important;
    }
}
