:root {
  --report-surface: #fff;
  --report-soft: #f1f6f1;
  --report-line: #dce6dd;
  --report-green: #326a3a;
}

button, input, select { font: inherit; }
button { cursor: pointer; }
button:disabled { cursor: default; opacity: .42; }
.visually-hidden { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0; }

.report-shell { width: min(100% - 40px, 1120px); }
.report-shell .info-nav { width: min(100%, 780px); margin-inline: auto; }
.report-hero { display: flex; align-items: end; justify-content: space-between; gap: 28px; padding: 47px 0 34px; }
.report-hero > div { min-width: 0; }
.report-hero .eyebrow { margin-bottom: 10px; }
.report-hero h1 { max-width: none; }
.report-hero p:not(.eyebrow) { margin-top: 11px; }
.period-control { display: grid; flex: 0 0 204px; gap: 6px; color: var(--muted); font-size: .78rem; font-weight: 650; }
.period-control select, .category-filter select { appearance: none; width: 100%; min-height: 43px; padding: 0 33px 0 14px; border: 1px solid #cad9cd; border-radius: 8px; background: #fff url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath d='m1 1 5 5 5-5' fill='none' stroke='%235e6d63' stroke-width='1.5'/%3E%3C/svg%3E") no-repeat right 13px center; color: var(--ink); font-size: .88rem; }
.report-content { padding-top: 26px; }
.data-status { margin-bottom: 18px; padding: 12px 15px; border: 1px solid #e8d7a8; border-radius: 8px; background: #fff9e9; color: #6b5017; font-size: .88rem; }

.metric-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 13px; margin-bottom: 20px; }
.metric-card { display: flex; flex-direction: column; min-width: 0; min-height: 145px; padding: 20px; border: 1px solid var(--report-line); border-radius: 11px; background: var(--report-surface); }
.metric-card-primary { border-color: #b9d8bd; background: #edf7ee; }
.metric-top { display: flex; justify-content: space-between; align-items: start; gap: 8px; color: #495d4e; font-size: .87rem; font-weight: 650; }
.metric-symbol { color: var(--report-green); font-size: 1.27rem; line-height: 1; }
.metric-card strong { margin: 15px 0 4px; color: #1d3323; font-size: clamp(1.65rem, 2.6vw, 2.15rem); font-weight: 650; line-height: 1.1; letter-spacing: -.04em; font-variant-numeric: tabular-nums; }
.metric-card small { margin-top: auto; color: #687b6c; font-size: .75rem; line-height: 1.4; }

.analysis-grid { display: grid; grid-template-columns: minmax(0, 1.7fr) minmax(280px, 1fr); gap: 15px; margin-bottom: 22px; }
.report-card { min-width: 0; border: 1px solid var(--report-line); border-radius: 11px; background: var(--report-surface); }
.trend-card, .category-card { min-height: 316px; padding: 23px 24px 16px; }
.card-header { display: flex; align-items: start; justify-content: space-between; gap: 16px; }
.section-kicker { margin: 0 0 5px; color: var(--report-green); font-size: .71rem; font-weight: 750; letter-spacing: .09em; text-transform: uppercase; }
.card-header h2 { margin: 0; color: #253a29; font-size: 1.13rem; font-weight: 650; line-height: 1.3; }
.chart-key { display: inline-flex; align-items: center; gap: 7px; color: var(--muted); font-size: .75rem; white-space: nowrap; }
.chart-key i { width: 9px; height: 9px; border-radius: 50%; background: #5aa66a; }
.chart-scroll { overflow-x: auto; margin-top: 16px; scrollbar-color: #b8cfbd transparent; scrollbar-width: thin; }
.trend-chart { min-width: 100%; }
.trend-chart svg { display: block; height: 217px; }
.trend-chart .grid { stroke: #e0e8e1; stroke-width: 1; }
.trend-chart .axis-text { fill: #718578; font-size: 11px; font-family: inherit; }
.trend-chart .bar { fill: url(#report-bar); }
.trend-chart .bar:hover { fill: #58a96a; }
.category-bars { display: grid; align-content: center; gap: 18px; min-height: 236px; padding: 13px 0 2px; }
.category-row { display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: center; gap: 6px 12px; font-size: .83rem; }
.category-row strong { font-weight: 630; }
.category-row span { color: var(--muted); font-variant-numeric: tabular-nums; }
.category-track { grid-column: 1 / -1; height: 9px; overflow: hidden; border-radius: 999px; background: #edf2ed; }
.category-track i { display: block; height: 100%; border-radius: inherit; background: #67ad74; }
.empty-chart { display: grid; place-items: center; min-height: 195px; margin: 0; color: var(--muted); font-size: .87rem; text-align: center; }

.records-card { margin-bottom: 20px; padding-top: 22px; scroll-margin-top: 20px; }
.records-heading { align-items: center; padding: 0 24px 20px; }
.card-subtitle { margin: 5px 0 0; color: var(--muted); font-size: .83rem; }
.record-count { display: inline-grid; place-items: center; min-width: 33px; height: 27px; padding: 0 7px; border-radius: 6px; background: #e6f1e7; color: var(--report-green); font-size: .79rem; font-weight: 700; }
.table-toolbar { display: flex; flex-wrap: wrap; gap: 9px; padding: 0 24px 16px; }
.search-box { position: relative; flex: 1 1 235px; max-width: 380px; }
.search-box > span[aria-hidden] { position: absolute; top: 4px; left: 13px; color: #778d7b; font-size: 1.5rem; line-height: 1; }
.search-box input { width: 100%; min-height: 40px; padding: 0 12px 0 38px; border: 1px solid #cad9cd; border-radius: 8px; background: #fff; color: var(--ink); font-size: .87rem; }
.search-box input::placeholder { color: #748778; }
.category-filter { min-width: 170px; }
.category-filter select { min-height: 40px; }
.export-button { display: inline-flex; align-items: center; justify-content: center; gap: 7px; min-height: 40px; padding: 0 14px; border: 1px solid #bfd7c3; border-radius: 8px; background: #edf7ee; color: var(--report-green); font-size: .83rem; font-weight: 650; white-space: nowrap; }
.export-button:hover { background: #dcefe0; }
.export-button > span:first-child { font-size: 1.2rem; line-height: 1; }
.table-scroll { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; text-align: left; }
thead { background: #f4f8f4; }
th { padding: 12px 24px; color: #627768; font-size: .74rem; font-weight: 700; white-space: nowrap; }
th button { display: inline-flex; align-items: center; gap: 6px; padding: 0; border: 0; background: none; color: inherit; font: inherit; }
th button:hover, th[aria-sort] button { color: var(--report-green); }
td { padding: 14px 24px; border-top: 1px solid #e9eee9; color: #4c6151; font-size: .84rem; white-space: nowrap; font-variant-numeric: tabular-nums; }
tbody tr:hover { background: #f9fcf9; }
td:first-child { max-width: 480px; overflow: hidden; color: #253a29; font-weight: 620; text-overflow: ellipsis; }
.category-pill { display: inline-flex; padding: 4px 9px; border-radius: 6px; background: #e9f2f3; color: #32636b; font-size: .75rem; font-weight: 650; }
.category-pill[data-category="study"] { background: #e9f3e9; color: #316d3c; }
.category-pill[data-category="work"] { background: #e9eefb; color: #405b95; }
.category-pill[data-category="reading"] { background: #fcf1dd; color: #8c641f; }
.category-pill[data-category="personal"] { background: #f2ebf7; color: #76528e; }
.table-empty { padding: 34px 24px 41px; border-top: 1px solid var(--report-line); color: var(--muted); font-size: .87rem; text-align: center; }
.table-footer { display: flex; align-items: center; justify-content: space-between; min-height: 55px; padding: 9px 24px; border-top: 1px solid var(--report-line); color: var(--muted); font-size: .78rem; }
.pagination { display: flex; gap: 6px; }
.pagination button { width: 31px; height: 30px; border: 1px solid var(--report-line); border-radius: 6px; background: #fff; color: var(--ink); font-size: 1.2rem; line-height: 1; }
.pagination button:hover:not(:disabled) { border-color: var(--report-green); }
.sessions-card td:first-child { max-width: none; }
.source-note { margin: 27px 0 14px; color: var(--muted); font-size: .8rem; }
.report-shell .info-footer { margin-top: 20px; }

@media (max-width: 900px) {
  .metric-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .analysis-grid { grid-template-columns: 1fr; }
  .category-card { min-height: 0; }
  .category-bars { min-height: 160px; }
}
@media (max-width: 680px) {
  .report-shell { width: min(100% - 32px, 1120px); }
  .report-hero { align-items: stretch; flex-direction: column; gap: 21px; }
  .period-control { flex: none; }
  .metric-grid { gap: 9px; }
  .metric-card { min-height: 136px; padding: 16px; }
  .metric-card strong { font-size: 1.7rem; }
  .trend-card, .category-card { padding: 18px; }
  .card-header { flex-wrap: wrap; }
  .records-heading { padding: 0 17px 18px; }
  .table-toolbar { padding: 0 17px 14px; }
  .search-box { max-width: none; }
  .category-filter { flex: 1 1 160px; }
  th, td { padding-left: 16px; padding-right: 16px; }
}
@media (max-width: 390px) {
  .metric-grid { grid-template-columns: 1fr; }
  .metric-card { min-height: 116px; }
}
@media print {
  .report-shell { width: 100%; }
  .info-nav, .table-toolbar, .pagination, .period-control, .export-button { display: none; }
  .report-card, .metric-card { break-inside: avoid; box-shadow: none; }
  .table-scroll, .chart-scroll { overflow: visible; }
}
