/* ==========================================
   WEEKLY REPORT — narrative mirror overlay
   ========================================== */

#report-overlay {
    position: fixed;
    inset: 0;
    background: rgba(9, 10, 12, 0.64);
    backdrop-filter: blur(5px);
    z-index: 45;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
}
#report-overlay.hidden { display: none; }

.report-card {
    width: min(680px, 100%);
    max-height: min(82vh, 720px);
    display: flex;
    flex-direction: column;
    border-radius: 18px;
    border: 1px solid var(--border-subtle);
    background: var(--bg-surface);
    box-shadow: 0 20px 50px rgba(0,0,0,0.33);
}

.report-header { padding: 18px 20px; display: flex; gap: 12px; align-items: flex-start; border-bottom: 1px solid var(--border-subtle); }
#report-title { margin: 0; font-size: 1.08rem; font-family: 'Noto Serif JP', serif; }
#report-subtitle { margin: 4px 0 0; color: var(--text-secondary); font-size: 0.84rem; }
#report-close-btn {
    margin-left: auto; border: 1px solid var(--border-subtle); border-radius: 9px; background: transparent;
    color: var(--text-secondary); width: 36px; height: 36px; font-size: 1.35rem;
}
#report-close-btn:hover { color: var(--text-primary); background: var(--interactive-hover-bg); }

#report-content { overflow: auto; padding: 20px 24px 24px; -webkit-overflow-scrolling: touch; }
.report-narrative { color: var(--text-primary); line-height: 1.65; font-size: 0.95rem; white-space: pre-wrap; }
.report-section-title {
    margin: 22px 0 8px; color: var(--text-secondary); font-size: 0.78rem;
    text-transform: uppercase; letter-spacing: 0.08em;
}
.report-open-loops { margin: 0; padding-left: 18px; color: var(--text-primary); line-height: 1.6; }
.report-open-loops li { margin-bottom: 4px; }
.report-small-action {
    margin: 8px 0 0; padding: 12px 14px; border-radius: 12px;
    border: 1px solid rgba(196,169,106,0.35); background: rgba(196,169,106,0.06);
    color: var(--text-primary); line-height: 1.5; font-style: italic;
}
.report-empty { color: var(--text-secondary); text-align: center; padding: 40px 16px; line-height: 1.6; }
.report-loading { color: var(--text-muted); text-align: center; padding: 40px 16px; }
.report-review-cta {
    margin-top: 26px; display: flex; justify-content: center;
}
.report-review-cta button {
    padding: 9px 16px; border-radius: 10px; border: 1px solid rgba(196,169,106,0.45);
    color: var(--accent-gold); background: rgba(196,169,106,0.08); font-size: 0.88rem;
}
.report-review-cta button:hover { color: var(--text-primary); background: rgba(196,169,106,0.16); }

@media (max-width: 768px) {
    #report-overlay {
        box-sizing: border-box;
        flex-direction: column;
        justify-content: stretch;
        align-items: stretch;
        padding:
            max(12px, env(safe-area-inset-top, 0px))
            max(12px, env(safe-area-inset-right, 0px))
            max(16px, env(safe-area-inset-bottom, 0px))
            max(12px, env(safe-area-inset-left, 0px));
    }
    .report-card { width: 100%; max-height: none; flex: 1; min-height: 0; border-radius: 16px; }
    .report-header { padding: 16px; flex-shrink: 0; }
    #report-content { flex: 1; min-height: 0; }
}
