
* { box-sizing: border-box; }
body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', system-ui, sans-serif;
  max-width: 900px;
  margin: 0 auto;
  padding: 1.5rem;
  background: #f7f8fa;
  color: #333;
  line-height: 1.6;
}
body.wide { max-width: 1100px; }
h1 { color: #1a1a1a; border-bottom: 2px solid #e74c3c; padding-bottom: 0.5rem; margin-top: 0; }
h2 { margin-top: 2rem; color: #2c3e50; }
h3 { color: #34495e; }
a { color: #3498db; text-decoration: none; }
a:hover { text-decoration: underline; }

/* Nav */
nav { margin-bottom: 1.5rem; padding-bottom: 0.75rem; border-bottom: 1px solid #ddd; display: flex; gap: 1.5rem; align-items: center; }
nav a { font-weight: 500; }
nav a.active { color: #e74c3c; font-weight: 600; }

/* Search */
.search-box { margin-left: auto; }
.search-box input {
  padding: 0.4rem 0.75rem;
  border: 1px solid #ccc;
  border-radius: 20px;
  font-size: 0.9rem;
  width: 220px;
  outline: none;
  transition: border-color 0.2s;
}
.search-box input:focus { border-color: #3498db; }

/* Tables */
table { width: 100%; border-collapse: collapse; margin: 1rem 0; background: white; box-shadow: 0 1px 3px rgba(0,0,0,0.1); border-radius: 6px; overflow: hidden; }
th, td { padding: 0.6rem 0.75rem; text-align: left; border-bottom: 1px solid #eee; font-size: 0.9rem; }
th { background: #34495e; color: white; font-weight: 500; }
tr:hover { background: #f8f9fa; }
.normal { color: #27ae60; }
.low { color: #e67e22; font-weight: bold; }
.high { color: #e74c3c; font-weight: bold; }

.summary { background: #fff3cd; border-left: 4px solid #ffc107; padding: 1rem; margin: 1rem 0; border-radius: 0 6px 6px 0; }
.meta { color: #666; font-size: 0.9rem; margin-bottom: 1rem; }
footer { margin-top: 3rem; color: #aaa; font-size: 0.8rem; text-align: center; }

/* Report list */
.report-list { list-style: none; padding: 0; }
.report-list li {
  padding: 0.75rem 1rem; margin-bottom: 0.5rem;
  background: white; border-radius: 6px;
  box-shadow: 0 1px 3px rgba(0,0,0,0.06);
  display: flex; justify-content: space-between; align-items: flex-start;
  gap: 1rem; transition: box-shadow 0.15s;
}
.report-list li:hover { box-shadow: 0 2px 8px rgba(0,0,0,0.12); }
.report-info { flex: 1; min-width: 0; }
.report-date { color: #888; font-size: 0.85rem; font-family: 'SF Mono', 'Fira Code', monospace; white-space: nowrap; }
.key-items { display: flex; flex-wrap: wrap; gap: 0.3rem; margin-top: 0.4rem; }
.key-tag {
  font-size: 0.72rem; padding: 0.1rem 0.45rem; border-radius: 3px;
  white-space: nowrap;
}
.tag-high { background: #fdecea; color: #c0392b; }
.tag-low { background: #fef3e2; color: #d35400; }
.tag-more { background: #eee; color: #888; }
.key-finding { font-size: 0.78rem; color: #666; line-height: 1.3; }

/* ===== TRENDS PAGE ===== */
.trends-subtitle { color: #666; margin: -0.5rem 0 1.5rem; font-size: 0.95rem; }

/* Dashboard card */
.dash-card {
  background: white; border-radius: 10px; padding: 1.25rem;
  box-shadow: 0 1px 4px rgba(0,0,0,0.08);
  margin-bottom: 1.5rem;
}
.dash-card h2 {
  margin: 0 0 1rem; font-size: 1.05rem; color: #2c3e50;
  padding-bottom: 0.5rem; border-bottom: 1px solid #eee;
}
.dash-card canvas { width: 100% !important; }

/* Toggle actions */
.toggle-actions {
  display: flex; gap: 0.5rem; padding-top: 0.75rem;
}
.toggle-actions button {
  padding: 0.25rem 0.75rem; font-size: 0.8rem;
  border: 1px solid #ccc; border-radius: 4px;
  background: #f8f9fa; cursor: pointer; color: #555;
}
.toggle-actions button:hover { background: #e9ecef; }

/* Toggle panel */
.toggle-panel {
  display: flex; flex-wrap: wrap; gap: 0.25rem 0.75rem;
  padding: 0.75rem 0; font-size: 0.82rem;
}
.toggle-panel label {
  display: flex; align-items: center; gap: 0.3rem;
  cursor: pointer; padding: 0.15rem 0;
  white-space: nowrap;
}
.toggle-panel input[type=checkbox] { margin: 0; cursor: pointer; }
.toggle-group { margin-bottom: 0.5rem; }
.toggle-group-title {
  font-weight: 600; font-size: 0.8rem; color: #888;
  text-transform: uppercase; letter-spacing: 0.5px;
  margin-bottom: 0.25rem;
}

/* Section headers */
.section-header {
  display: flex; justify-content: space-between; align-items: center;
  cursor: pointer; user-select: none;
}
.section-header .toggle-icon { font-size: 0.8rem; color: #888; transition: transform 0.2s; }
.section-header.collapsed .toggle-icon { transform: rotate(-90deg); }
.collapsible { overflow: hidden; transition: max-height 0.3s ease; }
.collapsible.collapsed { max-height: 0 !important; }

/* Individual charts grid */
.chart-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; margin-top: 1rem; }
.chart-mini {
  background: white; border-radius: 8px; padding: 0.75rem;
  box-shadow: 0 1px 3px rgba(0,0,0,0.06);
}
.chart-mini h3 { margin: 0 0 0.5rem; font-size: 0.85rem; color: #555; }

/* Search results */
.search-results { margin-top: 1rem; }
.search-result-card {
  background: white; border-radius: 8px; padding: 1rem;
  margin-bottom: 0.75rem; box-shadow: 0 1px 3px rgba(0,0,0,0.06);
}
.search-result-card .result-header {
  display: flex; justify-content: space-between; align-items: center;
  margin-bottom: 0.5rem;
}
.search-result-card .result-date { font-family: monospace; color: #888; font-size: 0.85rem; }
.search-result-card .result-title { font-weight: 600; color: #2c3e50; }
.search-result-card mark { background: #fff3cd; padding: 0 2px; border-radius: 2px; }
.search-result-card .result-section { color: #666; font-size: 0.85rem; margin-bottom: 0.25rem; }
.search-result-card .result-text { font-size: 0.9rem; line-height: 1.5; }
#search-results-container { display: none; }

@media (max-width: 700px) {
  body { padding: 1rem; }
  body.wide { max-width: 100%; }
  .report-list li { flex-direction: column; align-items: flex-start; gap: 0.25rem; }
  .chart-grid { grid-template-columns: 1fr; }
  .search-box input { width: 140px; }
}
