/* Device preview drawer */
.drawer-backdrop {
    position: fixed;
    inset: 0;
    z-index: 80;
    background: rgba(0, 0, 0, 0.55);
    opacity: 0;
    pointer-events: none;
    transition: opacity 150ms ease;
}

.drawer-backdrop.open { opacity: 1; pointer-events: auto; }

.device-drawer {
    position: fixed;
    top: 0;
    right: 0;
    z-index: 90;
    width: min(520px, 94vw);
    height: 100vh;
    overflow-y: auto;
    background: #0f172a;
    border-left: 1px solid var(--border);
    box-shadow: var(--shadow);
    transform: translateX(102%);
    transition: transform 170ms ease;
}

.device-drawer.open { transform: translateX(0); }

.drawer-header {
    position: sticky;
    top: 0;
    z-index: 2;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 16px 18px;
    background: rgba(15, 23, 42, 0.97);
    border-bottom: 1px solid var(--border);
}

.drawer-close {
    width: 38px;
    height: 38px;
    border: 0;
    border-radius: 9px;
    background: var(--panel-3);
    color: var(--text);
    cursor: pointer;
    font-size: 20px;
}

.drawer-body { padding: 18px; }
.drawer-loading { color: var(--muted); padding: 40px 0; text-align: center; }
.drawer-title { margin: 0; font-size: 25px; }
.drawer-model-name { margin-top: 5px; color: var(--muted); }

.drawer-main-image {
    width: 100%;
    max-height: 330px;
    object-fit: contain;
    display: block;
    margin-bottom: 16px;
    border-radius: 11px;
    background: #020617;
    border: 1px solid var(--border);
}

.drawer-photo-strip {
    display: flex;
    gap: 8px;
    overflow-x: auto;
    margin: 10px 0 18px;
}

.drawer-photo-strip button {
    padding: 0;
    border: 1px solid var(--border);
    border-radius: 8px;
    background: transparent;
    cursor: pointer;
}

.drawer-photo-strip img {
    width: 76px;
    height: 58px;
    object-fit: cover;
    display: block;
    border-radius: 7px;
}

.detail-grid {
    display: grid;
    grid-template-columns: 130px minmax(0, 1fr);
    gap: 9px 14px;
    padding: 15px 0;
    border-top: 1px solid var(--border-soft);
    border-bottom: 1px solid var(--border-soft);
}

.detail-label { color: var(--muted); }
.detail-value { overflow-wrap: anywhere; }
.drawer-notes { white-space: pre-wrap; line-height: 1.55; color: var(--muted-2); }
.drawer-events { display: grid; gap: 9px; }
.drawer-event { padding: 10px 12px; border-radius: 9px; background: var(--panel-2); }
.drawer-event-title { font-weight: 700; }
.drawer-event-meta { margin-top: 3px; color: var(--muted); font-size: 12px; }
.drawer-event-description { margin-top: 6px; color: var(--muted-2); font-size: 13px; white-space: pre-wrap; }


/* Non-modal comparison beside the current AI draft on wide screens. */
.comparison-help { padding: 12px 18px; color: var(--muted-2); }
.comparison-uploaded-photos { display: flex; flex-wrap: wrap; gap: 10px; margin: 12px 0 20px; }
.comparison-uploaded-photos img { width: 180px; height: 150px; object-fit: contain; background: var(--panel-2); border: 1px solid var(--border); border-radius: 8px; }
.comparison-drawer .drawer-main-image { object-fit: contain; }
@media (min-width: 1100px) {
    body.comparison-open .page-shell { width: auto; max-width: none; margin-left: 20px; margin-right: 550px; }
    body.comparison-open #drawerBackdrop { display: none; }
}
@media (max-width: 1099px) {
    .comparison-drawer { width: min(520px, 100vw); }
}
