/* Recovery layer for the complete local residence database and focused sharing flows. */
#panel-planting .crop-grid-item {
    min-height: 148px !important;
    padding: 0 0 8px !important;
    overflow: hidden;
    align-items: stretch;
}

#panel-planting .crop-grid-art {
    width: 100% !important;
    max-width: none !important;
    height: 70px;
    aspect-ratio: auto !important;
    padding: 4px;
    border: 0;
    border-bottom: 1px solid rgba(72, 103, 87, .11);
    border-radius: 11px 11px 0 0;
    background: linear-gradient(145deg, #e6efe8, #f9f5e9);
}

#panel-planting .crop-grid-art img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    object-position: center;
}

#panel-planting .crop-grid-name,
#panel-planting .crop-grid-info {
    padding-inline: 8px;
}
#panel-planting .crop-grid-name { margin: 6px 0 2px !important; font-size: 12px; line-height: 1.25; }
#panel-planting .crop-grid-info { margin: 0 !important; font-size: 10px; gap: 8px; flex-direction: row; flex-wrap: wrap; }

#weekendCalcPanel .weekend-info,
#weekendCalcPanel .calc-water-settings {
    display: none !important;
}

.weekend-compact-note {
    margin: 0 0 14px;
    color: var(--text-muted, #687970);
    font-size: 12px;
    line-height: 1.7;
}

.home-economy-search > span {
    flex: 0 0 auto;
    white-space: nowrap;
}

.hall-toolbar--focused,
#merchantShareContent > .hall-toolbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
}

.hall-toolbar--focused > div,
#merchantShareContent > .hall-toolbar > div {
    display: flex;
    min-width: 0;
    flex-direction: column;
    gap: 3px;
}

.hall-toolbar--focused strong,
#merchantShareContent > .hall-toolbar strong {
    color: var(--text-dark, #263b33);
    font-size: 14px;
}

.hall-toolbar--focused small,
#merchantShareContent > .hall-toolbar small {
    color: var(--text-muted, #75847d);
    font-size: 10px;
}

.home-ranch-active-heading {
    display: flex;
    align-items: end;
    justify-content: space-between;
    gap: 16px;
    margin: 26px 0 12px;
}

.home-ranch-active-heading p {
    margin: 0 0 4px;
    color: #507d69;
    font-size: 9px;
    font-weight: 800;
    letter-spacing: .14em;
}

.home-ranch-active-heading h2 {
    margin: 0;
    color: #263b33;
    font-size: 21px;
}

.home-ranch-active-heading > span {
    color: #7c8b83;
    font-size: 10px;
}

.ranch-active-name {
    display: inline-flex;
    align-items: center;
    gap: 9px;
}

.ranch-active-icon,
.ranch-active-fallback,
.ranch-product-icon {
    width: 42px;
    height: 42px;
    flex: 0 0 42px;
    border-radius: 11px;
    background: #e9f0e9;
    object-fit: contain;
}

.ranch-active-fallback {
    display: grid;
    place-items: center;
    color: #507d69;
    font-weight: 800;
}

.ranch-active-product {
    display: flex !important;
    align-items: center;
    gap: 10px;
}

.ranch-active-product > span {
    display: flex;
    min-width: 0;
    flex-direction: column;
    gap: 3px;
}

.ranch-active-product small {
    color: #75847d;
    font-size: 10px;
}

@media (max-width: 768px) {
    .panel.active {
        animation: none !important;
    }

    .content-panels {
        min-height: 0 !important;
    }

    #panel-planting .crop-grid-item {
        min-height: 132px !important;
        padding: 0 0 6px !important;
    }

    #panel-planting .crop-grid-art {
        height: 58px;
        padding: 3px;
    }

    #panel-planting .crop-grid-name { margin: 5px 0 1px !important; font-size: 11px; }
    #panel-planting .crop-grid-info { font-size: 9px; }

    .hall-toolbar--focused,
    #merchantShareContent > .hall-toolbar,
    .home-ranch-active-heading {
        align-items: stretch;
        flex-direction: column;
    }

    #panel-ranch > .toolbar {
        display: grid;
        width: 100%;
        grid-template-columns: minmax(0, 1fr) auto;
        padding-right: 5px;
    }

    #panel-ranch > .toolbar .toolbar-left,
    #panel-ranch > .toolbar .toolbar-right {
        min-width: 0;
    }

    #addRanchAnimalBtn {
        min-width: 0 !important;
        padding: 7px 9px !important;
        font-size: 10px !important;
    }

    .home-economy-heading > span {
        max-width: 94px;
        font-size: 8px;
        text-align: right;
        white-space: normal;
    }

    #merchantShareContent .hall-table,
    #cropSaleShareContent .hall-table {
        min-width: 0;
    }

    #merchantShareContent .hall-table thead,
    #cropSaleShareContent .hall-table thead {
        display: none;
    }

    #merchantShareContent .hall-table tbody,
    #merchantShareContent .hall-table tr,
    #merchantShareContent .hall-table td,
    #cropSaleShareContent .hall-table tbody,
    #cropSaleShareContent .hall-table tr,
    #cropSaleShareContent .hall-table td {
        display: block;
        width: 100%;
    }

    #merchantShareContent .hall-table tr,
    #cropSaleShareContent .hall-table tr {
        margin-bottom: 12px;
        padding: 13px;
        border: 1px solid rgba(72, 103, 87, .13);
        border-radius: 14px;
        background: #fffdf8;
    }

    #merchantShareContent .hall-table td,
    #cropSaleShareContent .hall-table td {
        padding: 5px 0;
        border: 0;
    }

    .home-economy-hero {
        min-height: 420px;
        grid-template-columns: 1fr;
        padding: 28px 20px;
        background-position: 62% center;
    }

    .home-economy-hero h1 {
        max-width: 9em;
        font-size: 2.65rem;
    }

    .home-economy-stats {
        align-self: end;
    }
}

/* 庭院经营 · 作物选择：紧凑网格 + 计数 + 内部滚动，避免窄屏每屏只露约 6 个作物 */
#panel-planting .crop-select-head {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 10px;
    margin-bottom: 6px;
}
#panel-planting .crop-grid-count {
    color: #6b848a;
    font-size: 11px;
    font-weight: 800;
    white-space: nowrap;
}
#panel-planting .crop-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr)) !important;
    gap: 7px;
    padding: 4px 4px 6px;
    border: 1px solid rgba(72, 103, 87, .12);
    border-radius: 12px;
    background: rgba(255, 255, 255, .55);
}
#panel-planting .crop-grid::-webkit-scrollbar { width: 8px; }
#panel-planting .crop-grid::-webkit-scrollbar-thumb { background: #c5d8d2; border-radius: 8px; }
#panel-planting .crop-grid-empty {
    grid-column: 1 / -1;
    padding: 24px 0;
    text-align: center;
    color: #8aa0a0;
    font-size: 13px;
}
