/* Detail Panel Component Styles */

/* Detail Panel (Modal) */
.detail-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.5);
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s, visibility 0.3s;
    z-index: 100;
    backdrop-filter: blur(4px);
}

.detail-overlay.active {
    opacity: 1;
    visibility: visible;
}

.detail-panel {
    position: fixed;
    bottom: 0;
    left: 50%;
    transform: translateX(-50%) translateY(100%);
    width: 100%;
    max-width: 480px;
    max-height: 90vh;
    background: var(--aff-bg);
    border-radius: var(--aff-radius-lg) var(--aff-radius-lg) 0 0;
    padding: var(--aff-space-24);
    overflow-y: auto;
    scrollbar-width: thin;
    scrollbar-color: var(--aff-border-subtle) transparent;
    transition: transform 0.3s ease-out;
    z-index: 101;
}

.detail-panel::-webkit-scrollbar {
    width: 6px;
}

.detail-panel::-webkit-scrollbar-track {
    background: transparent;
}

.detail-panel::-webkit-scrollbar-thumb {
    background: var(--aff-border-subtle);
    border-radius: 3px;
}

.detail-panel::-webkit-scrollbar-thumb:hover {
    background: var(--aff-secondary);
}

.detail-overlay.active .detail-panel {
    transform: translateX(-50%) translateY(0);
}

.detail-handle {
    width: 36px;
    height: 4px;
    background: var(--aff-border-strong);
    border-radius: 2px;
    margin: 0 auto var(--aff-space-16);
}

.detail-header {
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
    align-items: flex-start;
    gap: var(--aff-space-12);
}

.detail-header > div:first-child {
    flex: 1;
    min-width: 0;
}

.detail-title {
    min-width: 0;
}

.detail-make {
    font-size: var(--aff-text-xl);
    font-weight: 700;
    letter-spacing: -0.02em;
}

.detail-model {
    font-size: var(--aff-text-base);
    font-weight: 500;
    letter-spacing: -0.01em;
    color: var(--aff-secondary);
    margin-top: 2px;
}

.detail-header-buttons {
    display: flex;
    gap: var(--aff-space-8);
    align-items: center;
    flex-shrink: 0;
}

.detail-share,
.detail-watchlist {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: var(--aff-secondary-soft);
    border: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--aff-ink-muted);
    transition: background 0.2s, color 0.2s;
}

.detail-share:hover,
.detail-watchlist:hover {
    background: var(--aff-border-strong);
}

/* Watchlist button states */
.detail-watchlist .watchlist-icon {
    width: 18px;
    height: 18px;
}

.detail-watchlist .watchlist-icon--filled {
    display: none;
}

.detail-watchlist.in-watchlist {
    background: var(--aff-accent-soft);
    color: var(--aff-accent);
}

.detail-watchlist.in-watchlist .watchlist-icon--outline {
    display: none;
}

.detail-watchlist.in-watchlist .watchlist-icon--filled {
    display: block;
}

.detail-watchlist.in-watchlist:hover {
    background: var(--aff-accent);
    color: #fff;
}

.detail-close {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: var(--aff-secondary-soft);
    border: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.25rem;
    color: var(--aff-ink-muted);
    transition: background 0.2s;
}

.detail-close:hover {
    background: var(--aff-border-strong);
}

/* Share Lightbox */
.share-lightbox {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.6);
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s, visibility 0.3s;
    z-index: 200;
    backdrop-filter: blur(4px);
}

.share-lightbox.active {
    opacity: 1;
    visibility: visible;
}

.share-lightbox-content {
    background: var(--aff-bg-elevated);
    border-radius: var(--aff-radius-lg);
    padding: var(--aff-space-24) var(--aff-space-24);
    max-width: 480px;
    width: 90%;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    transform: scale(0.95);
    transition: transform 0.3s ease;
}

.share-lightbox.active .share-lightbox-content {
    transform: scale(1);
}

.share-lightbox-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: var(--aff-space-20);
}

.share-lightbox-title {
    font-size: var(--aff-text-lg);
    font-weight: 600;
    color: var(--aff-ink);
    margin: 0;
}

.share-lightbox-close {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: var(--aff-secondary-soft);
    border: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.25rem;
    color: var(--aff-ink-muted);
    transition: background 0.2s;
}

.share-lightbox-close:hover {
    background: var(--aff-border-strong);
}

.share-lightbox-body {
    display: flex;
    flex-direction: column;
    gap: var(--aff-space-12);
}

.share-label {
    font-size: var(--aff-text-sm);
    color: var(--aff-ink-soft);
    font-weight: 500;
}

.share-input-container {
    display: flex;
    gap: var(--aff-space-8);
}

.share-input {
    flex: 1;
    padding: var(--aff-space-12) var(--aff-space-16);
    border-radius: var(--aff-radius-sm);
    border: 1px solid var(--aff-border-subtle);
    background: var(--aff-bg-soft);
    font-size: var(--aff-text-sm);
    font-family: inherit;
    color: var(--aff-ink);
}

.share-input:focus {
    outline: none;
    border-color: var(--aff-accent);
    box-shadow: 0 0 0 3px rgba(212, 154, 55, 0.15);
}

.share-copy-btn {
    padding: var(--aff-space-12) var(--aff-space-24);
    border-radius: var(--aff-radius-sm);
    border: none;
    background: var(--aff-primary);
    color: #fff;
    font-size: var(--aff-text-sm);
    font-weight: 600;
    cursor: pointer;
    transition: background 0.2s;
    white-space: nowrap;
}

.share-copy-btn:hover:not(:disabled) {
    background: var(--aff-primary-strong);
}

.share-copy-btn:disabled {
    background: var(--aff-secondary-soft);
    color: var(--aff-ink-muted);
    cursor: not-allowed;
}

.share-copied-message {
    font-size: var(--aff-text-sm);
    color: var(--aff-accent);
    font-weight: 500;
    text-align: center;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s, visibility 0.3s;
}

.share-copied-message.visible {
    opacity: 1;
    visibility: visible;
}

/* Detail Vehicle Image and Specs Row */
.detail-hero-row {
    display: flex;
    gap: var(--aff-space-16);
    margin: var(--aff-space-20) 0;
    align-items: stretch;
}

.detail-image-container {
    flex-shrink: 0;
    display: flex;
}

.detail-vehicle-img {
    width: 180px;
    height: auto;
    aspect-ratio: 1;
    object-fit: cover;
    border-radius: var(--aff-radius-md);
    background: var(--aff-bg-soft);
}

/* About Card */
.detail-about-card {
    background: var(--aff-bg-elevated);
    border-radius: var(--aff-radius-md);
    border: 1px solid var(--aff-border-subtle);
    margin-top: var(--aff-space-16);
    overflow: hidden;
}

.about-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    width: 100%;
    padding: var(--aff-space-16);
    background: transparent;
    border: none;
    cursor: pointer;
    transition: background 0.2s ease;
}

.about-header:hover {
    background: var(--aff-bg-soft);
}

.about-title {
    font-size: var(--aff-text-xs);
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--aff-ink-muted);
}

.about-chevron {
    font-size: var(--aff-text-lg);
    color: var(--aff-ink-muted);
    transition: transform 0.2s ease;
}

.about-header[aria-expanded="true"] .about-chevron {
    transform: rotate(90deg);
}

.about-header[aria-expanded="true"] {
    border-bottom: 1px solid var(--aff-border-subtle);
}

.about-content {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.3s ease;
}

.about-content.expanded {
    max-height: 500px;
}

.about-text {
    font-size: var(--aff-text-sm);
    line-height: 1.6;
    color: var(--aff-ink-secondary);
    margin: 0;
    padding: var(--aff-space-16);
}

/* TCN Card */
.detail-tcn-card {
    background: var(--aff-bg-elevated);
    border-radius: var(--aff-radius-md);
    border: 1px solid var(--aff-border-subtle);
    margin-top: var(--aff-space-20);
    overflow: hidden;
    display: flex;
    flex-direction: row;
    order: 0;
}

.tcn-logo-strip {
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--aff-bg-soft);
    border-right: 1px solid var(--aff-border-subtle);
    flex-shrink: 0;
    width: 36px;
    overflow: hidden;
}

.tcn-logo {
    width: auto;
    height: 14px;
    transform: rotate(90deg);
    opacity: 0.6;
    filter: invert(1);
}

.tcn-content {
    flex: 1;
    padding: var(--aff-space-16);
}

.tcn-grid {
    display: grid;
    grid-template-columns: repeat(6, 1fr);
    gap: var(--aff-space-8);
}

.tcn-item {
    aspect-ratio: 1;
    border-radius: var(--aff-radius-sm);
    background: var(--aff-bg-soft);
}

.tcn-placeholder {
    opacity: 0.3;
}

@media (max-width: 767px) {
    .tcn-logo-strip {
        width: 28px;
        padding: 4px;
    }

    .tcn-logo {
        height: 8px;
    }

    .tcn-content {
        padding: var(--aff-space-12);
    }

    .tcn-grid {
        gap: var(--aff-space-8);
    }
}

.dark-mode .tcn-placeholder {
    opacity: 0.5;
}

.dark-mode .tcn-logo {
    filter: none;
}

/* Traits Card */
.detail-traits-card {
    background: var(--aff-bg-elevated);
    border-radius: var(--aff-radius-md);
    border: 1px solid var(--aff-border-subtle);
    padding: var(--aff-space-16);
    margin-top: var(--aff-space-20);
    order: 1;  /* push below About card on mobile */
}

.traits-title {
    font-size: var(--aff-text-xs);
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--aff-ink-muted);
    margin-bottom: var(--aff-space-12);
}

.traits-grid {
    display: grid;
    grid-template-columns: repeat(6, 1fr);
    gap: var(--aff-space-8);
}

.trait-item {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: var(--aff-space-8);
    background: var(--aff-bg-soft);
    border-radius: var(--aff-radius-sm);
    transition: background 0.2s ease;
    cursor: pointer;
    min-height: 48px;
    position: relative;
}

.trait-item:hover:not(.trait-placeholder) {
    background: var(--aff-secondary-soft);
}

.trait-placeholder {
    background: var(--aff-bg-soft);
    opacity: 0.3;
    cursor: default;
}

.trait-icon {
    width: 28px;
    height: 28px;
    object-fit: contain;
}

/* Invert trait icons in dark mode for visibility */
.dark-mode .trait-icon {
    filter: invert(1);
}

.trait-tooltip {
    display: none;
    position: absolute;
    bottom: calc(100% + 8px);
    left: 50%;
    transform: translateX(-50%);
    padding: 10px 12px;
    background: #1a1a18;
    color: #fff;
    font-size: 12px;
    font-family: var(--aff-font-sans);
    font-weight: 400;
    line-height: 1.4;
    white-space: nowrap;
    text-align: center;
    border-radius: 8px;
    z-index: 100;
    pointer-events: none;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.trait-tooltip::after {
    content: '';
    position: absolute;
    top: 100%;
    left: 50%;
    transform: translateX(-50%);
    border: 6px solid transparent;
    border-top-color: #1a1a18;
}

.trait-item.tooltip-active .trait-tooltip {
    display: block;
}

/* Show tooltip on hover for desktop */
@media (hover: hover) {
    .trait-item:not(.trait-placeholder):hover .trait-tooltip {
        display: block;
    }
}

/* Notable Owners Card */
.detail-owners-card {
    background: var(--aff-bg-elevated);
    border-radius: var(--aff-radius-md);
    border: 1px solid var(--aff-border-subtle);
    padding: var(--aff-space-16);
    margin-top: var(--aff-space-16);
    order: 50;
}

.owners-title {
    font-size: var(--aff-text-xs);
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--aff-ink-muted);
    margin-bottom: var(--aff-space-12);
}

.owners-grid {
    display: flex;
    flex-wrap: wrap;
    gap: var(--aff-space-12);
    justify-content: center;
}

.owner-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    cursor: pointer;
    position: relative;
    text-decoration: none;
    color: inherit;
    transition: transform 0.2s ease;
}

.owner-item:hover {
    transform: translateY(-2px);
}

.owner-placeholder {
    cursor: default;
}

.owner-placeholder .owner-avatar {
    opacity: 0.3;
}

.owner-avatar {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    border: 2px solid var(--aff-border-subtle);
    overflow: hidden;
    background: var(--aff-bg-soft);
    display: flex;
    align-items: center;
    justify-content: center;
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.owner-avatar-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.owner-initials {
    font-size: var(--aff-text-sm);
    font-weight: 600;
    color: var(--aff-ink-muted);
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    height: 100%;
}

.owner-tooltip {
    display: none;
    position: absolute;
    bottom: calc(100% + 8px);
    left: 50%;
    transform: translateX(-50%);
    padding: 10px 12px;
    background: #1a1a18;
    color: #fff;
    font-size: 12px;
    font-family: var(--aff-font-sans);
    font-weight: 400;
    line-height: 1.4;
    white-space: nowrap;
    text-align: center;
    border-radius: 8px;
    z-index: 100;
    pointer-events: none;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.owner-tooltip::after {
    content: '';
    position: absolute;
    top: 100%;
    left: 50%;
    transform: translateX(-50%);
    border: 6px solid transparent;
    border-top-color: #1a1a18;
}

.owner-item.tooltip-active .owner-tooltip {
    display: block;
}

/* Show tooltip on hover for desktop */
@media (hover: hover) {
    .owner-item:hover .owner-tooltip {
        display: block;
    }
}

/* Accent border + shadow for linked owners on hover */
a.owner-item:hover .owner-avatar {
    border-color: var(--aff-accent);
    box-shadow: 0 2px 8px rgba(212, 154, 55, 0.3);
}

.detail-specs-card {
    flex: 1;
    background: var(--aff-bg-elevated);
    border-radius: var(--aff-radius-md);
    border: 1px solid var(--aff-border-subtle);
    padding: var(--aff-space-16);
    display: flex;
    flex-direction: column;
    justify-content: space-between;
}

.specs-title {
    font-size: var(--aff-text-xs);
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--aff-ink-muted);
    margin-bottom: var(--aff-space-8);
}

.specs-row {
    display: flex;
    justify-content: space-between;
    padding: var(--aff-space-6) 0;
    border-bottom: 1px solid var(--aff-border-subtle);
    gap: var(--aff-space-8);
}

.specs-row:last-child {
    border-bottom: none;
}

.specs-label {
    font-size: var(--aff-text-sm);
    color: var(--aff-ink-muted);
    flex-shrink: 1;
    min-width: 0;
}

.specs-value {
    font-size: var(--aff-text-sm);
    font-weight: 600;
    color: var(--aff-ink);
    flex-shrink: 0;
    text-align: right;
}

.detail-price {
    font-size: var(--aff-text-xxl);
    font-weight: 700;
    letter-spacing: -0.03em;
}

.detail-change {
    font-size: var(--aff-text-base);
    font-weight: 500;
    margin-top: var(--aff-space-4);
}

/* Chart Container */
.chart-container {
    height: 400px;
    background: var(--aff-bg-elevated);
    border-radius: var(--aff-radius-md);
    border: 1px solid var(--aff-border-subtle);
    margin: var(--aff-space-20) 0;
    order: 2;  /* after traits (1) on mobile */
    padding: var(--aff-space-16);
    padding-bottom: var(--aff-space-24);
    position: relative;
    overflow: hidden;
}

.chart-container canvas {
    width: 100% !important;
    height: 100% !important;
}

/* Time Range Pills */
.time-range {
    display: flex;
    justify-content: center;
    gap: var(--aff-space-8);
    margin: var(--aff-space-16) 0;
    order: 2;
}

.time-pill {
    padding: var(--aff-space-8) var(--aff-space-12);
    border-radius: 999px;
    border: 1px solid var(--aff-border-subtle);
    background: transparent;
    font-size: var(--aff-text-xs);
    font-weight: 600;
    color: var(--aff-ink-muted);
    cursor: pointer;
    transition: all 0.2s;
}

.time-pill:hover {
    background: var(--aff-primary-soft);
}

.time-pill.active {
    background: var(--aff-primary);
    border-color: var(--aff-primary);
    color: #fff;
}

.time-pill.disabled {
    opacity: 0.35;
    cursor: not-allowed;
    pointer-events: none;
}

/* Stats Grid in Detail */
.detail-stats {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: var(--aff-space-12);
    margin: var(--aff-space-20) 0;
    order: 2;
}

.detail-stat {
    background: var(--aff-bg-elevated);
    border-radius: var(--aff-radius-sm);
    border: 1px solid var(--aff-border-subtle);
    padding: var(--aff-space-12);
}

.detail-stat-label {
    font-size: var(--aff-text-xs);
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: var(--aff-ink-muted);
}

.detail-stat-value {
    font-size: var(--aff-text-md);
    font-weight: 600;
    color: var(--aff-ink);
    margin-top: var(--aff-space-4);
}

/* Projection Section */
.projection-section {
    margin-top: var(--aff-space-20);
    background: linear-gradient(135deg, rgba(0, 122, 255, 0.08), rgba(0, 122, 255, 0.02));
    border: 1px solid rgba(0, 122, 255, 0.2);
    border-radius: var(--aff-radius-md);
    padding: var(--aff-space-16);
    order: 2;
}

.projection-header {
    display: flex;
    align-items: center;
    gap: var(--aff-space-8);
    margin-bottom: var(--aff-space-12);
}

.projection-icon {
    font-size: 16px;
}

.projection-title {
    font-size: var(--aff-text-sm);
    font-weight: 600;
    color: #007AFF;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.info-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 16px;
    height: 16px;
    margin-left: 6px;
    font-size: 10px;
    font-weight: 600;
    font-style: italic;
    font-family: Georgia, serif;
    color: var(--aff-ink-muted);
    background: var(--aff-secondary-soft);
    border: 1px solid var(--aff-border-subtle);
    border-radius: 50%;
    cursor: help;
    transition: all 0.2s ease;
    position: relative;
}

.info-icon:hover {
    color: var(--aff-ink);
    background: var(--aff-border-strong);
    border-color: var(--aff-secondary);
}

.info-icon::after {
    content: attr(data-tooltip);
    position: absolute;
    bottom: calc(100% + 6px);
    left: 50%;
    transform: translateX(-50%);
    padding: 10px 12px;
    background: #1a1a18;
    color: #fff;
    font-size: 12px;
    font-style: normal;
    font-family: var(--aff-font-sans);
    font-weight: 400;
    line-height: 1.4;
    width: 280px;
    white-space: normal;
    text-align: left;
    border-radius: 8px;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.15s ease, visibility 0.15s ease;
    pointer-events: none;
    z-index: 100;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.info-icon::before {
    content: '';
    position: absolute;
    bottom: calc(100% + 2px);
    left: 50%;
    transform: translateX(-50%);
    border: 4px solid transparent;
    border-top-color: #1a1a18;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.15s ease, visibility 0.15s ease;
    pointer-events: none;
    z-index: 100;
}

.info-icon:hover::after,
.info-icon:hover::before {
    opacity: 1;
    visibility: visible;
}

.projection-content {
    display: flex;
    flex-direction: column;
    gap: var(--aff-space-4);
}

.projection-price {
    font-size: var(--aff-text-xl);
    font-weight: 700;
    color: #007AFF;
}

.projection-meta {
    display: flex;
    align-items: center;
    gap: var(--aff-space-12);
    font-size: var(--aff-text-sm);
    color: var(--aff-ink-muted);
}

.projection-rate {
    color: var(--aff-accent);
    font-weight: 500;
}

/* Sales History */
.sales-section {
    margin-top: var(--aff-space-24);
    order: 51;
}

.sales-title {
    font-size: var(--aff-text-md);
    font-weight: 600;
    margin-bottom: var(--aff-space-12);
}

.sales-list {
    display: flex;
    flex-direction: column;
}

.sale-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: var(--aff-space-12) 0;
    border-bottom: 1px solid var(--aff-border-subtle);
}

.sale-item:last-child {
    border-bottom: none;
}

.sale-info {
    display: flex;
    flex-direction: column;
}

.sale-date {
    font-size: var(--aff-text-sm);
    font-weight: 500;
    color: var(--aff-ink);
}

.sale-date--unavailable {
    color: var(--aff-ink-muted);
    filter: blur(1px);
    opacity: 0.6;
}

.sale-source {
    font-size: var(--aff-text-xs);
    color: var(--aff-ink-muted);
    text-transform: capitalize;
    margin-top: 2px;
}

.sale-price {
    text-align: right;
}

.sale-price-row {
    display: flex;
    align-items: center;
    gap: 8px;
}

.sale-country-flag {
    font-size: 1.1rem;
    line-height: 1;
    width: 24px;
    text-align: center;
    flex-shrink: 0;
}

.sale-price {
    text-align: right;
    min-width: 90px;
}

.sale-price-usd {
    font-size: var(--aff-text-sm);
    font-weight: 600;
    color: var(--aff-ink);
}

.sale-price-original {
    font-size: var(--aff-text-xs);
    color: var(--aff-ink-muted);
    margin-top: 2px;
}

/* News Section */
.news-section {
    margin-top: var(--aff-space-24);
    padding-top: var(--aff-space-16);
    border-top: 1px solid var(--aff-border-subtle);
    order: 52;
}

.news-title {
    font-size: var(--aff-text-md);
    font-weight: 600;
    color: var(--aff-ink);
    margin-bottom: var(--aff-space-12);
}

.news-list {
    display: flex;
    flex-direction: column;
    gap: 1px;
    background: var(--aff-border-subtle);
    border-radius: var(--aff-radius-lg);
    overflow: hidden;
}

@keyframes shimmer {
    0%   { background-position: -400px 0; }
    100% { background-position: 400px 0; }
}

.news-skeleton-item {
    padding: var(--aff-space-12) var(--aff-space-16);
    background: var(--aff-bg);
}

.news-skeleton-line {
    height: 12px;
    border-radius: 6px;
    background: linear-gradient(
        90deg,
        var(--aff-border-subtle) 25%,
        var(--aff-bg) 50%,
        var(--aff-border-subtle) 75%
    );
    background-size: 800px 100%;
    animation: shimmer 1.5s infinite linear;
}

.news-skeleton-headline {
    width: 85%;
    margin-bottom: 8px;
}

.news-skeleton-meta {
    width: 50%;
    height: 10px;
}

.news-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: var(--aff-space-12) var(--aff-space-16);
    background: var(--aff-bg);
    text-decoration: none;
    transition: background 0.15s ease;
}

.news-item:hover {
    background: var(--aff-surface);
}

.news-content {
    flex: 1;
    min-width: 0;
}

.news-headline {
    font-size: var(--aff-text-sm);
    font-weight: 500;
    color: var(--aff-ink);
    line-height: 1.4;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.news-meta {
    display: flex;
    gap: var(--aff-space-8);
    margin-top: 4px;
    font-size: var(--aff-text-xs);
    color: var(--aff-ink-muted);
}

.news-source {
    font-weight: 500;
}

.news-arrow {
    color: var(--aff-ink-muted);
    font-size: var(--aff-text-md);
    margin-left: var(--aff-space-8);
    flex-shrink: 0;
}

.news-item-pinned {
    background: var(--aff-accent-soft);
}

.news-item-pinned:hover {
    background: color-mix(in srgb, var(--aff-accent-soft) 80%, var(--aff-accent) 20%);
}

.news-pinned {
    display: inline-block;
    font-size: var(--aff-text-xs);
    font-weight: 600;
    color: var(--aff-accent);
    background: var(--aff-bg-elevated);
    padding: 2px 6px;
    border-radius: 4px;
    margin-right: var(--aff-space-8);
    vertical-align: middle;
}

/* Vehicle change colors */
.vehicle-change--positive {
    color: #34c759;
}

.vehicle-change--negative {
    color: #ff3b30;
}

/* On mobile, detail-body is a flex column so CSS order controls visual order.
   The column wrappers are invisible (display: contents) so their children
   become direct flex items of detail-body. */
.detail-body { display: flex; flex-direction: column; }
.detail-col--left { display: contents; }
.detail-col--right { display: contents; }

/* Price in header — on mobile, stack below title with change underneath */
.detail-header-price {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: var(--aff-space-4);
    width: 100%;
    margin-top: var(--aff-space-4);
    order: 3;
}

.detail-header-buttons {
    order: 2;
}

/* Responsive label switching */
.label-short {
    display: none;
}

.label-full {
    display: inline;
}

@media (max-width: 480px) {
    .label-short {
        display: inline;
    }

    .label-full {
        display: none;
    }
}

/* Desktop: centered wide modal with two-column layout */
@media (min-width: 768px) {
    /* Panel positioning: centered modal */
    .detail-panel {
        bottom: auto;
        top: 50%;
        left: 50%;
        transform: translate(-50%, -50%) scale(0.95);
        opacity: 0;
        width: 92vw;
        max-width: 1100px;
        max-height: 85vh;
        border-radius: var(--aff-radius-lg);
        overflow: hidden;
        transition: transform 0.3s ease-out, opacity 0.3s ease-out;
    }

    .detail-overlay.active .detail-panel {
        transform: translate(-50%, -50%) scale(1);
        opacity: 1;
    }

    /* Hide mobile handle */
    .detail-handle {
        display: none;
    }

    /* Header: inline layout with price */
    .detail-header {
        flex-wrap: nowrap;
        align-items: flex-start;
        border-bottom: 1px solid var(--aff-border-subtle);
        padding-bottom: var(--aff-space-16);
        margin-bottom: var(--aff-space-4);
    }

    .detail-header-price {
        margin-left: auto;
        flex-direction: column;
        align-items: flex-end;
        width: auto;
        margin-top: 0;
        order: 0;
        gap: 0;
    }

    .detail-header-buttons {
        order: 0;
    }

    .detail-header-price .detail-price {
        font-size: var(--aff-text-xl);
    }

    .detail-make,
    .detail-header-price .detail-price {
        line-height: 1.2;
    }

    .detail-model,
    .detail-header-price .detail-change {
        line-height: 1.4;
        margin-top: 2px;
    }

    /* Two-column body */
    .detail-body {
        display: grid;
        grid-template-columns: 360px 1fr;
        gap: var(--aff-space-24);
        overflow-y: auto;
        scrollbar-width: thin;
        scrollbar-color: var(--aff-border-subtle) transparent;
        max-height: calc(85vh - 100px);
        padding-top: var(--aff-space-16);
    }

    .detail-body::-webkit-scrollbar {
        width: 6px;
    }

    .detail-body::-webkit-scrollbar-track {
        background: transparent;
    }

    .detail-body::-webkit-scrollbar-thumb {
        background: var(--aff-border-subtle);
        border-radius: 3px;
    }

    .detail-body::-webkit-scrollbar-thumb:hover {
        background: var(--aff-secondary);
    }

    .detail-col--left,
    .detail-col--right {
        display: block;
    }

    /* Left column sticky */
    .detail-col--left {
        position: sticky;
        top: 0;
        align-self: start;
    }

    /* Image: full-width within left column */
    .detail-hero-row {
        flex-direction: column;
        margin-top: 0;
    }

    .detail-vehicle-img {
        width: 100%;
        max-width: none;
    }

    /* Right column padding for content breathing room */
    .detail-col--right {
        padding-right: var(--aff-space-16);
        padding-bottom: var(--aff-space-24);
    }

    /* Chart: slightly taller */
    .chart-container {
        height: 420px;
        margin-top: var(--aff-space-20);
    }

    /* About card: static (no accordion) on desktop */
    .detail-about-card {
        margin-top: 0;
        margin-bottom: var(--aff-space-16);
    }

    .about-header {
        cursor: default;
        pointer-events: none;
    }

    .about-header:hover {
        background: transparent;
    }

    .about-chevron {
        display: none;
    }

    .about-content {
        max-height: none;
        overflow: visible;
    }

    .about-header[aria-expanded="true"] {
        border-bottom: 1px solid var(--aff-border-subtle);
    }

    /* Reset mobile ordering on desktop — normal block flow within columns */
    .detail-traits-card,
    .detail-tcn-card,
    .chart-container,
    .time-range,
    .detail-stats,
    .projection-section,
    .detail-owners-card,
    .sales-section,
    .news-section {
        order: 0;
    }

}
