.planner-page {
    min-height: 100vh;
    padding: 40px 0 120px;
}

.planner-hero {
    padding: 40px 0 0;
}

.planner-shell {
    display: grid;
    grid-template-columns: 1fr;
    gap: 52px;
    align-items: start;
}

.planner-intro-wrap {
    display: grid;
    grid-template-columns: minmax(0, 0.95fr) minmax(320px, 0.85fr);
    gap: 52px;
    align-items: center;
}

.planner-intro {
    max-width: 760px;
    padding: 24px 0 0;
}

.planner-intro h1 {
    margin: 0 0 24px;
    max-width: 10ch;
    font: italic 700 clamp(44px, 5vw, 76px) / 0.92 Georgia, "Times New Roman", serif;
    letter-spacing: -0.04em;
}

.planner-lead {
    max-width: 40rem;
}

.planner-hero-media {
    overflow: hidden;
    border-radius: var(--r-lg);
    box-shadow: var(--shadow);
    background: var(--bg-soft);
    aspect-ratio: 5 / 4;
}

.planner-hero-media img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.planner-limit {
    display: inline-flex;
    flex-direction: column;
    gap: 4px;
    margin-top: 28px;
    padding: 18px 20px;
    border-radius: 22px;
    background: rgba(255, 255, 255, 0.72);
    border: 1px solid rgba(24, 61, 42, 0.08);
    box-shadow: var(--shadow);
}

.planner-limit strong {
    font: italic 700 26px/1 Georgia, "Times New Roman", serif;
    color: var(--primary);
}

.planner-limit span,
.planner-note,
.control-head p,
.control-subhead p,
.summary-text,
.timeline-month span {
    color: var(--muted);
}

.planner-card {
    max-width: 980px;
    padding: 44px;
    border-radius: 34px;
    background: rgba(255, 255, 255, 0.7);
    border: 1px solid rgba(24, 61, 42, 0.08);
    box-shadow: var(--shadow);
    backdrop-filter: blur(10px);
}

.planner-card-head,
.summary-panel,
.timeline-row,
.crop-meta,
.toggle-group,
.timeline-month {
    display: flex;
}

.planner-card-head,
.summary-panel,
.timeline-row {
    align-items: flex-start;
    justify-content: space-between;
    gap: 18px;
}

.planner-card-head h2,
.control-head h3,
.control-subhead h3,
.control-subhead h4 {
    margin: 0;
}

.planner-card-head h2 {
    font: italic 700 clamp(30px, 3vw, 44px) / 1 Georgia, "Times New Roman", serif;
}

.planner-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 28px;
    margin-top: 36px;
}

.control-panel,
.summary-panel,
.timeline-panel {
    border-radius: 26px;
    border: 1px solid rgba(24, 61, 42, 0.08);
    background: rgba(248, 244, 237, 0.72);
}

.control-panel {
    padding: 32px;
}

.summary-panel,
.timeline-panel {
    padding: 32px;
}

.control-head p,
.control-subhead p,
.planner-note,
.summary-text {
    margin: 8px 0 0;
}

.greenhouse-field {
    margin: 28px 0 0;
    padding: 0;
    border: 0;
}

.greenhouse-field legend {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 14px;
    font-size: 12px;
    font-weight: 800;
    letter-spacing: 0.18em;
    text-transform: uppercase;
    color: var(--terra);
}

.crop-icon,
.max-icon {
    display: inline-grid;
    place-items: center;
}

.toggle-group {
    gap: 12px;
}

.toggle-pill {
    flex: 1;
    position: relative;
}

.toggle-pill input {
    position: absolute;
    opacity: 0;
    inset: 0;
}

.toggle-pill span {
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: flex-start;
    min-height: 74px;
    padding: 14px 18px;
    border-radius: 24px;
    border: 1px solid rgba(24, 61, 42, 0.12);
    background: rgba(255, 255, 255, 0.8);
    transition: border-color 180ms ease, background-color 180ms ease, color 180ms ease;
}

.toggle-pill strong {
    display: block;
    font: 800 13px/1.1 Inter, sans-serif;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.toggle-pill em {
    display: block;
    margin-top: 6px;
    color: var(--muted);
    font: 500 14px/1.4 Inter, sans-serif;
    font-style: normal;
    letter-spacing: 0;
    text-transform: none;
}

.toggle-pill input:checked + span {
    color: var(--white);
    background: linear-gradient(135deg, #1d5b3f, #2a7a55);
    border-color: transparent;
}

.toggle-pill input:checked + span em {
    color: rgba(255, 255, 255, 0.82);
}

.crop-picker {
    margin-top: 26px;
}

.crop-list {
    display: grid;
    gap: 16px;
    margin-top: 22px;
    grid-template-columns: repeat(2, minmax(0, 1fr));
}

.crop-item {
    position: relative;
    display: grid;
    grid-template-columns: auto 1fr;
    gap: 16px;
    align-items: start;
    min-height: 160px;
    padding: 22px;
    border-radius: 28px;
    background: linear-gradient(180deg, rgba(255, 255, 255, 0.98), rgba(255, 255, 255, 0.88));
    border: 1px solid rgba(24, 61, 42, 0.08);
    box-shadow: 0 18px 34px rgba(24, 61, 42, 0.07);
    cursor: pointer;
    transition: transform 180ms ease, box-shadow 180ms ease, border-color 180ms ease;
}

.crop-item:hover,
.crop-item:focus-within {
    transform: translateY(-2px);
    box-shadow: 0 24px 44px rgba(24, 61, 42, 0.10);
}

.crop-meta {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    justify-content: space-between;
    min-height: 100%;
    gap: 14px;
}

.crop-check {
    position: absolute;
    top: 18px;
    right: 18px;
    width: 22px;
    height: 22px;
    margin: 0;
    accent-color: var(--primary);
}

.crop-icon,
.max-icon {
    width: 54px;
    height: 54px;
    border-radius: 18px;
    overflow: hidden;
    background: rgba(255, 255, 255, 0.92);
    box-shadow: inset 0 0 0 1px rgba(24, 61, 42, 0.08);
}

.crop-icon img,
.max-icon img {
    width: 38px;
    height: 38px;
    object-fit: contain;
}

.crop-meta strong,
.status-box strong,
.timeline-month strong,
.timeline-capacity strong {
    display: block;
}

.crop-meta span {
    display: block;
    margin-top: 2px;
    color: var(--muted);
    font-size: 14px;
}

.crop-meta small {
    display: inline-flex;
    align-items: center;
    min-height: 30px;
    padding: 0 12px;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.78);
    color: rgba(27, 28, 25, 0.72);
    font-size: 11px;
    font-weight: 800;
    letter-spacing: 0.12em;
    text-transform: uppercase;
}

.accent-peppers {
    background:
        radial-gradient(circle at top right, rgba(216, 92, 63, 0.18), transparent 32%),
        linear-gradient(180deg, rgba(255, 248, 244, 0.98), rgba(255, 255, 255, 0.9));
}

.accent-tomatoes {
    background:
        radial-gradient(circle at top right, rgba(233, 87, 70, 0.20), transparent 32%),
        linear-gradient(180deg, rgba(255, 245, 243, 0.98), rgba(255, 255, 255, 0.9));
}

.accent-eggplant {
    background:
        radial-gradient(circle at top right, rgba(117, 74, 145, 0.18), transparent 32%),
        linear-gradient(180deg, rgba(249, 244, 252, 0.98), rgba(255, 255, 255, 0.9));
}

.accent-cucumber {
    background:
        radial-gradient(circle at top right, rgba(89, 157, 117, 0.18), transparent 32%),
        linear-gradient(180deg, rgba(244, 251, 246, 0.98), rgba(255, 255, 255, 0.9));
}

.accent-courgette {
    background:
        radial-gradient(circle at top right, rgba(123, 168, 71, 0.18), transparent 32%),
        linear-gradient(180deg, rgba(247, 252, 242, 0.98), rgba(255, 255, 255, 0.9));
}

.accent-basil {
    background:
        radial-gradient(circle at top right, rgba(78, 142, 86, 0.18), transparent 32%),
        linear-gradient(180deg, rgba(243, 250, 244, 0.98), rgba(255, 255, 255, 0.9));
}

.accent-lettuce {
    background:
        radial-gradient(circle at top right, rgba(120, 181, 82, 0.18), transparent 32%),
        linear-gradient(180deg, rgba(247, 252, 244, 0.98), rgba(255, 255, 255, 0.9));
}

.planner-results {
    display: grid;
    gap: 24px;
}

.timeline-list {
    margin-top: 24px;
}

.timeline-panel-inline {
    padding: 30px 30px 34px;
}

.gantt-legend {
    display: flex;
    flex-wrap: wrap;
    gap: 10px 18px;
    margin-top: 18px;
}

.gantt-legend span {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    color: var(--muted);
    font-size: 13px;
}

.legend-swatch {
    width: 14px;
    height: 14px;
    border-radius: 4px;
}

.legend-seedbox {
    background: linear-gradient(135deg, #c95a3b, #e08963);
}

.legend-greenhouse {
    background: linear-gradient(135deg, #3f6c55, #5f9b7e);
}

.legend-outside {
    background: linear-gradient(135deg, #7c9e49, #a9c66f);
}

.legend-harvest {
    background: linear-gradient(135deg, #d3a13c, #e8c66c);
}

.gantt-shell {
    display: grid;
    gap: 22px;
}

.gantt-chart {
    display: grid;
    gap: 16px;
}

.gantt-header,
.gantt-row {
    display: grid;
    grid-template-columns: 240px minmax(0, 1fr);
    gap: 26px;
    align-items: start;
}

.gantt-header {
    padding: 0 0 10px;
    border-bottom: 1px solid rgba(24, 61, 42, 0.08);
}

.gantt-sidehead {
    font-size: 11px;
    font-weight: 800;
    letter-spacing: 0.16em;
    text-transform: uppercase;
    color: var(--terra);
}

.gantt-label {
    display: flex;
    align-items: flex-start;
    gap: 14px;
    min-width: 0;
    padding-top: 10px;
}

.gantt-label strong {
    display: block;
    font-size: 16px;
}

.gantt-label span {
    display: block;
    margin-top: 4px;
    color: var(--muted);
    font-size: 13px;
    line-height: 1.4;
}

.gantt-duration {
    display: block;
    margin-top: 10px;
    color: var(--muted);
    font-size: 12px;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.gantt-icon {
    display: grid;
    place-items: center;
    width: 48px;
    height: 48px;
    flex: 0 0 auto;
    border-radius: 16px;
    background: rgba(255, 255, 255, 0.92);
    box-shadow: inset 0 0 0 1px rgba(24, 61, 42, 0.08);
}

.gantt-icon img {
    width: 34px;
    height: 34px;
    object-fit: contain;
}

.gantt-months,
.gantt-occupancy-grid {
    display: grid;
    grid-template-columns: repeat(var(--month-count, 12), minmax(0, 1fr));
    gap: 10px;
}

.gantt-track {
    display: grid;
    grid-template-columns: repeat(var(--month-count, 12), minmax(0, 1fr));
    gap: 0;
}

.gantt-months span {
    text-align: center;
    font-size: 11px;
    font-weight: 800;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: rgba(76, 81, 76, 0.66);
}

.gantt-lane {
    display: grid;
    gap: 10px;
    align-items: start;
}

.gantt-track {
    align-items: center;
}

.gantt-track-cell,
.gantt-bar {
    grid-row: 1;
}

.gantt-track-cell {
    min-height: 28px;
    background: rgba(24, 61, 42, 0.05);
    border-right: 1px solid rgba(24, 61, 42, 0.08);
}

.gantt-track-cell:first-child {
    border-radius: 999px 0 0 999px;
}

.gantt-track-cell:last-child {
    border-right: 0;
    border-radius: 0 999px 999px 0;
}

.gantt-bar {
    z-index: 1;
    min-height: 28px;
    margin: 0;
    padding: 0 8px;
    border-radius: 0;
    box-shadow: 0 8px 14px rgba(24, 61, 42, 0.10);
    border: 1px solid rgba(255, 255, 255, 0.16);
    display: flex;
    align-items: center;
}

.gantt-bar-start {
    border-top-left-radius: 999px;
    border-bottom-left-radius: 999px;
}

.gantt-bar-end {
    border-top-right-radius: 999px;
    border-bottom-right-radius: 999px;
}

.gantt-bar span {
    font-size: 11px;
    font-weight: 800;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--white);
}

.gantt-phase-seedbox {
    background: linear-gradient(135deg, #c95a3b, #e08963);
}

.gantt-phase-greenhouse {
    background: linear-gradient(135deg, #3f6c55, #5f9b7e);
}

.gantt-phase-outside {
    background: linear-gradient(135deg, #7c9e49, #a9c66f);
}

.gantt-phase-harvest {
    background: linear-gradient(135deg, #d3a13c, #e8c66c);
}

.max-list {
    display: grid;
    grid-template-columns: 1fr;
    gap: 14px;
    margin-top: 24px;
}

.allocation-summary,
.allocation-card {
    padding: 22px;
    border-radius: 20px;
    background: rgba(255, 255, 255, 0.84);
    border: 1px solid rgba(24, 61, 42, 0.08);
}

.allocation-summary strong {
    display: block;
    font-size: 18px;
}

.allocation-summary p {
    margin: 8px 0 0;
    color: var(--muted);
}

.allocation-ok {
    background:
        linear-gradient(180deg, rgba(242, 248, 244, 0.96), rgba(255, 255, 255, 0.88));
}

.allocation-warning {
    background:
        linear-gradient(180deg, rgba(255, 245, 241, 0.96), rgba(255, 255, 255, 0.88));
}

.allocation-card {
    display: grid;
    gap: 18px;
    align-items: start;
}

.allocation-group-head {
    display: grid;
    grid-template-columns: auto minmax(0, 1fr) auto;
    gap: 16px;
    align-items: center;
}

.allocation-title {
    min-width: 0;
}

.max-label {
    display: block;
    margin-bottom: 6px;
    font-size: 11px;
    font-weight: 800;
    letter-spacing: 0.14em;
    text-transform: uppercase;
    color: var(--terra);
}

.allocation-note {
    margin: 0;
    color: var(--muted);
    font-size: 13px;
}

.allocation-value {
    display: block;
    font: italic 700 clamp(24px, 2vw, 32px) / 1.08 Georgia, "Times New Roman", serif;
    color: var(--primary);
}

.shared-slider-shell {
    position: relative;
    padding: 6px 0;
}

.shared-slider-track {
    position: relative;
    height: 56px;
    border-radius: 999px;
    background: rgba(24, 61, 42, 0.06);
    overflow: hidden;
    box-shadow: inset 0 0 0 1px rgba(24, 61, 42, 0.08);
}

.allocation-segment {
    position: absolute;
    top: 0;
    bottom: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0 16px;
    color: var(--white);
    box-shadow: inset -1px 0 0 rgba(255, 255, 255, 0.2);
}

.allocation-segment span {
    font-size: 12px;
    font-weight: 800;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    white-space: nowrap;
}

.allocation-segment-start {
    border-top-left-radius: 999px;
    border-bottom-left-radius: 999px;
}

.allocation-segment-end {
    border-top-right-radius: 999px;
    border-bottom-right-radius: 999px;
}

.allocation-peppers {
    background: linear-gradient(135deg, #c95a3b, #e08963);
}

.allocation-tomatoes {
    background: linear-gradient(135deg, #d04c48, #ea7760);
}

.allocation-eggplant {
    background: linear-gradient(135deg, #6b4a8b, #8f6db1);
}

.allocation-cucumber {
    background: linear-gradient(135deg, #4d8d63, #6cad83);
}

.allocation-courgette {
    background: linear-gradient(135deg, #7c9e49, #a9c66f);
}

.allocation-basil {
    background: linear-gradient(135deg, #2f7a64, #4da28c);
}

.allocation-lettuce {
    background: linear-gradient(135deg, #7fa851, #a3c86b);
}

.shared-slider {
    position: absolute;
    top: 0;
    right: 0;
    left: 0;
    z-index: 3;
}

.shared-slider.noUi-target,
.shared-slider .noUi-target {
    height: 56px;
    border: 0;
    background: transparent;
    box-shadow: none;
}

.shared-slider .noUi-base,
.shared-slider .noUi-connects {
    height: 56px;
}

.shared-slider .noUi-connect,
.shared-slider .noUi-connects {
    background: transparent;
}

.shared-slider .noUi-handle {
    width: 18px;
    height: 18px;
    right: -9px;
    top: 19px;
    border: 0;
    border-radius: 50%;
    background: var(--white);
    box-shadow: 0 8px 16px rgba(24, 61, 42, 0.22);
    cursor: ew-resize;
}

.shared-slider .noUi-handle::before,
.shared-slider .noUi-handle::after {
    display: none;
}

.allocation-meta {
    display: grid;
    gap: 6px;
}

.allocation-legend {
    display: grid;
    gap: 12px;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
}

.allocation-legend-item {
    display: grid;
    grid-template-columns: auto minmax(0, 1fr);
    gap: 12px;
    align-items: center;
}

.allocation-meta p,
.empty-state {
    margin: 0;
    color: var(--muted);
}

.empty-state {
    padding: 16px 18px;
    border-radius: 20px;
    background: rgba(255, 255, 255, 0.84);
    border: 1px solid rgba(24, 61, 42, 0.08);
}

.planner-nav {
    display: flex;
}

.planner-nav a {
    font-size: 11px;
    font-weight: 800;
    letter-spacing: 0.14em;
    text-transform: uppercase;
    color: var(--muted);
}

@media (max-width: 900px) {
    .planner-page {
        padding-top: 12px;
        padding-bottom: 72px;
    }

    .planner-hero {
        padding-top: 0;
    }

    .planner-intro-wrap {
        grid-template-columns: 1fr;
        gap: 28px;
    }

    .planner-intro h1 {
        max-width: 10ch;
        font-size: 42px;
    }

    .planner-card,
    .control-panel,
    .summary-panel,
    .timeline-panel {
        padding: 20px;
    }

    .planner-card-head,
    .summary-panel,
    .timeline-row {
        flex-direction: column;
        align-items: stretch;
    }

    .toggle-group {
        display: grid;
        grid-template-columns: 1fr;
    }

    .max-list {
        grid-template-columns: 1fr;
    }

    .crop-list {
        grid-template-columns: 1fr;
    }

    .crop-item,
    .allocation-card {
        min-height: 0;
    }

    .gantt-shell {
        gap: 14px;
        overflow-x: auto;
        padding-bottom: 6px;
    }

    .gantt-chart {
        min-width: 760px;
    }

    .gantt-header,
    .gantt-row {
        grid-template-columns: 160px minmax(0, 1fr);
        gap: 12px;
    }

    .gantt-months,
    .gantt-track {
        gap: 6px;
    }

    .gantt-track-cell {
        min-height: 16px;
    }

    .gantt-bar,
    .gantt-track-cell {
        margin: 0;
    }

    .allocation-group-head {
        grid-template-columns: 1fr;
    }

    .allocation-legend {
        grid-template-columns: 1fr;
    }
}
