/* ==========================================
   📋 Best Result Panels - 上排两图 + 下排全宽清单
   ========================================== */

:root {
    --best-panel-border: #e5e7eb;
    --best-panel-bg: #fafafa;
    --best-panel-title: #111827;
    --best-panel-muted: #4b5563;
    --best-panel-accent: #1e40af;
}

.result-location-summary {
    margin: 0 0 0.75rem;
    padding: 0.7rem 0.9rem;
    font-size: 0.875rem;
    line-height: 1.45;
    color: #0f172a;
    background: linear-gradient(135deg, #ecfdf5 0%, #f0f9ff 100%);
    border: 1px solid #a7f3d0;
    border-radius: 8px;
}

.result-location-summary.hidden {
    display: none;
}

.best-result-panels {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.85rem;
    width: 100%;
    align-items: stretch;
}

.best-result-panels.hidden {
    display: none;
}

.best-result-card {
    display: flex;
    flex-direction: column;
    min-width: 0;
    background: var(--best-panel-bg);
    border: 1px solid var(--best-panel-border);
    border-radius: 10px;
    overflow: hidden;
}

.best-result-card--list {
    grid-column: 1 / -1;
}

.best-result-card__head {
    padding: 0.65rem 0.75rem 0.4rem;
}

.best-result-card__title {
    margin: 0;
    font-size: 0.95rem;
    font-weight: 700;
    color: var(--best-panel-title);
    line-height: 1.3;
}

.best-result-card__desc {
    margin: 0.25rem 0 0;
    font-size: 0.75rem;
    line-height: 1.4;
    color: var(--best-panel-muted);
}

.best-result-card__media {
    position: relative;
    display: block;
    width: 100%;
    margin: 0;
    padding: 0;
    border: none;
    background: #fff;
    cursor: zoom-in;
    flex: 1;
}

.best-result-card__media img {
    display: block;
    width: 100%;
    height: auto;
    max-height: 360px;
    object-fit: contain;
    object-position: center;
    background: #fff;
}

.best-result-card__media--overlay .best-result-card__frame {
    position: relative;
    display: block;
    width: 100%;
}

.best-result-card__media--overlay .best-result-card__frame img {
    width: 100%;
    height: auto;
    max-height: 360px;
    object-fit: contain;
}

.best-result-card__media--overlay .best-result-card__markers {
    position: absolute;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
}

.best-result-card--list .best-result-card__table-wrap {
    padding: 0 0.75rem 0.85rem;
    overflow-x: auto;
    overflow-y: visible;
    max-height: none;
    flex: 1;
}

.best-plan-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.8125rem;
    line-height: 1.4;
}

.best-plan-table th,
.best-plan-table td {
    padding: 0.45rem 0.5rem;
    text-align: left;
    border-bottom: 1px solid #e5e7eb;
    vertical-align: top;
    word-break: break-word;
}

.best-plan-table th {
    color: var(--best-panel-accent);
    font-weight: 600;
    position: sticky;
    top: 0;
    background: var(--best-panel-bg);
}

.best-plan-table td:first-child,
.best-plan-table th:first-child {
    width: 2rem;
    font-weight: 700;
    white-space: nowrap;
}

/* Yard: # | Item | Type | Qty/Spec | Note */
.best-plan-table th:nth-child(2),
.best-plan-table td:nth-child(2) {
    min-width: 8rem;
    width: 32%;
}

.best-plan-table th:nth-child(3),
.best-plan-table td:nth-child(3) {
    width: 7.5rem;
    white-space: nowrap;
}

.best-plan-table th:nth-child(4),
.best-plan-table td:nth-child(4) {
    width: 7rem;
}

.best-plan-table th:nth-child(5),
.best-plan-table td:nth-child(5) {
    min-width: 6rem;
}

@media (max-width: 960px) {
    .best-result-panels {
        grid-template-columns: 1fr;
    }

    .best-result-card--list {
        grid-column: auto;
    }

    .best-result-card__media img,
    .best-result-card__media--overlay .best-result-card__frame img {
        max-height: 360px;
        object-fit: contain;
        background: #fff;
    }
}
