/* Monthly journal statistics and personal memories. */
.journal-insights-grid { display: grid; grid-template-columns: minmax(0, 1.6fr) minmax(0, 1fr); gap: 1.2rem; align-items: start; }
.journal-insights-grid > .panel { min-width: 0; }
.insights-status-row { display: flex; align-items: center; flex-wrap: wrap; gap: .5rem 1rem; margin-bottom: 1rem; }
.insights-status-row p { margin: 0; }
#journal-insights-retry[hidden] { display: none; }
.insights-month-heading { display: flex; align-items: end; justify-content: space-between; flex-wrap: wrap; gap: .8rem 1rem; }
.insights-month-heading h3 { margin-bottom: 0; }
.insights-month-controls { display: flex; flex-wrap: nowrap; gap: .35rem; align-items: center; max-width: 100%; }
.insights-month-controls .ghost-btn { display: inline-flex; align-items: center; justify-content: center; width: 40px; min-height: 44px; padding: .3rem; font: 1.45rem/1 system-ui, sans-serif; flex: 0 0 auto; }
.insights-month-controls .ghost-btn:disabled { opacity: .35; cursor: default; }
.insights-month-controls input { color-scheme: dark; box-sizing: border-box; background: #101421; color: #f3eee5; border: 1px solid #dfbd8536; border-radius: 8px; min-height: 44px; width: 170px; max-width: calc(100% - 88px); min-width: 0; padding: .45rem; font: .85rem/1.5 system-ui, sans-serif; }
.insights-month-controls input:focus-visible, #journal-insights button:focus-visible, #journal-insights summary:focus-visible, #journal-insights a:focus-visible { outline: 2px solid #dfbd85; outline-offset: 3px; }
.insights-metrics { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: .6rem; margin: 1.5rem 0 1rem; }
.insights-metrics strong { display: block; color: #f3eee5; font: 400 clamp(1.4rem, 2.6vw, 2rem)/1.3 Georgia, serif; }
.insights-metrics strong.mood-key { color: #dfbd85; }
.insights-metrics strong.energy-key { color: #9caee1; }
.insights-metrics strong small { font: .72rem/1.3 system-ui, sans-serif; color: #b6b3ba; white-space: nowrap; }
.insights-metrics > div > span { display: block; font-size: .72rem; line-height: 1.5; margin-top: .3rem; color: #b6b3ba; }
.insights-legend { display: flex; flex-wrap: wrap; gap: .35rem .85rem; color: #b6b3ba; font-size: .75rem; margin: 1.15rem 0 .4rem; }
.insights-chart { display: flex; align-items: stretch; gap: .35rem; }
.insights-chart-scale { display: flex; width: .6rem; flex: 0 0 auto; flex-direction: column; justify-content: space-between; padding: 3.5% 0 7%; font-size: .65rem; color: #b6b3ba; }
.insights-chart-plot { min-width: 0; flex: 1; }
.insights-chart svg { display: block; width: 100%; height: auto; min-height: 85px; overflow: visible; }
.insights-chart-dates { display: flex; justify-content: space-between; color: #b6b3ba; font-size: .65rem; margin: -.3rem .1rem .65rem; }
.insights-data { margin-top: .8rem; border-top: 1px solid #dfbd8526; padding-top: .8rem; }
.insights-data summary, .insights-original summary { cursor: pointer; color: #dfbd85; font-size: .8rem; }
.insights-data table { border-collapse: collapse; width: 100%; table-layout: fixed; font-size: .75rem; margin-top: .75rem; }
.insights-data caption { text-align: left; font-size: .72rem; color: #b6b3ba; margin-bottom: .6rem; line-height: 1.5; }
.insights-data th, .insights-data td { text-align: center; border-bottom: 1px solid #dfbd851a; padding: .4rem .15rem; font-weight: 400; overflow-wrap: anywhere; }
.insights-data thead th { color: #dfbd85; }
.insights-data th:first-child { width: 20%; text-align: left; }
.insights-tags { margin-top: 1.2rem; }
.insights-tags h4 { font-size: .9rem; font-weight: 500; margin: 0 0 .7rem; }
.insights-tags ul { list-style: none; padding: 0; margin: 0 0 .8rem; }
.insights-tags li { display: flex; justify-content: space-between; gap: .75rem; padding: .4rem 0; border-bottom: 1px solid #dfbd851a; font-size: .78rem; }
.insights-tags li span { min-width: 0; overflow-wrap: anywhere; }
.insights-tags li strong { white-space: nowrap; color: #dfbd85; font-weight: 500; }
.insights-tags a, .insights-journal-link { color: #dfbd85; font-size: .8rem; text-underline-offset: 3px; }
.insights-memory h3 { margin-bottom: .65rem; }
.insights-memory > time { display: block; color: #dfbd85; font-size: .8rem; margin-bottom: 1rem; }
.insights-memory blockquote { white-space: pre-wrap; overflow-wrap: anywhere; margin: 1rem 0; border-left: 2px solid #dfbd8560; padding-left: 1rem; font: 400 1rem/1.7 Georgia, serif; }
.insights-memory .insights-question { font-size: .86rem; line-height: 1.6; margin: 1.2rem 0; }
.insights-memory > .ghost-btn { display: inline-flex; align-items: center; justify-content: center; box-sizing: border-box; min-height: 44px; max-width: 100%; white-space: normal; text-decoration: none; font-size: .8rem; text-align: center; }
.insights-journal-link { display: block; margin-top: 1rem; }
#journal-insights .tiny { font-size: .75rem; line-height: 1.6; }
@media (max-width: 1180px) { .journal-insights-grid { grid-template-columns: minmax(0, 1fr); } }
@media (max-width: 480px) { .insights-month-controls { width: 100%; } .insights-month-controls input { flex: 1; } .insights-metrics { gap: .4rem; } }
@media print { .insights-month-controls, #journal-insights-retry, .insights-memory > a, .insights-tags > a { display: none !important; } }
