.trend-section { margin-top: 46px; scroll-margin-top: 24px; }
.trend-title { margin-bottom: 18px; }
.trend-browser {
  display: grid;
  grid-template-columns: minmax(250px, .62fr) minmax(0, 1.38fr);
  gap: 14px;
}
.trend-index,
.trend-chart-card {
  min-width: 0;
  border: 1px solid var(--line);
  border-radius: 3px;
  background: rgba(255,255,255,.92);
  box-shadow: 0 8px 28px rgba(37,65,61,.035);
}
.trend-index { padding: 16px 14px 14px; }
.trend-category-filter {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 3px;
  padding-bottom: 13px;
  border-bottom: 1px solid #e7ece8;
}
.trend-category-filter button {
  min-width: 0;
  padding: 7px 5px;
  border: 1px solid transparent;
  border-radius: 2px;
  background: #f1f4f1;
  color: #75837e;
  font-size: 9px;
  cursor: pointer;
}
.trend-category-filter button:hover { color: var(--ink); }
.trend-category-filter button.active { border-color: var(--ink); background: var(--ink); color: #fff; }
.trend-metric-list {
  max-height: 428px;
  margin-top: 5px;
  overflow: auto;
  scrollbar-width: thin;
  scrollbar-color: #cbd5d0 transparent;
}
.trend-metric-button {
  width: 100%;
  display: grid;
  grid-template-columns: 29px minmax(0,1fr) auto;
  gap: 9px;
  align-items: center;
  padding: 11px 8px;
  border: 0;
  border-bottom: 1px solid #e8ece9;
  background: transparent;
  color: var(--ink);
  text-align: left;
  cursor: pointer;
}
.trend-metric-button:hover { background: #f7f9f6; }
.trend-metric-button.active { background: #edf5f2; box-shadow: inset 3px 0 var(--sea); }
.trend-metric-button .category-pill { width: 25px; height: 25px; }
.trend-metric-button > span:nth-child(2) { min-width: 0; }
.trend-metric-button b { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 12px; line-height: 1.45; }
.trend-metric-button small { display: block; margin-top: 4px; overflow: hidden; color: #8a9894; font-size: 10px; line-height: 1.4; text-overflow: ellipsis; white-space: nowrap; }
.trend-delta { min-width: 48px; color: #536c68; font-size: 10px; font-weight: 700; text-align: right; }
.trend-delta.up { color: #23806d; }
.trend-delta.down { color: #c55e4f; }

.trend-chart-card { padding: 22px 24px 19px; }
.trend-chart-heading { display: flex; justify-content: space-between; gap: 20px; align-items: flex-start; }
.trend-chart-heading > div {
  min-width: 0;
  display: grid;
  grid-template-columns: 32px minmax(0,1fr);
  grid-template-rows: auto auto;
  column-gap: 12px;
  align-items: center;
}
.trend-chart-heading p {
  grid-column: 2;
  margin: 0 0 4px;
  color: var(--sea);
  font-size: 9px;
  font-weight: 800;
  letter-spacing: .12em;
}
.trend-chart-heading h3 {
  grid-column: 2;
  min-width: 0;
  margin: 0;
  overflow: hidden;
  font: 600 clamp(19px,2vw,26px) Georgia,"Songti SC",serif;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.trend-category-code {
  grid-column: 1;
  grid-row: 1 / 3;
  width: 32px;
  height: 32px;
  display: grid;
  place-items: center;
  margin: 0;
  border-radius: 2px;
  background: var(--ink);
  color: #fff;
  font: italic 15px Georgia,serif;
}
.trend-stat-grid {
  display: grid;
  grid-template-columns: repeat(3,1fr);
  gap: 1px;
  margin-top: 20px;
  border: 1px solid #e0e6e1;
  background: #e0e6e1;
}
.trend-stat-grid > div { min-width: 0; padding: 12px 14px; background: #f8faf7; }
.trend-stat-grid small { display: block; margin-bottom: 5px; color: #82908c; font-size: 10px; }
.trend-stat-grid strong { display: block; overflow: hidden; color: var(--ink); font: italic 17px Georgia,"Songti SC",serif; text-overflow: ellipsis; white-space: nowrap; }
.trend-stat-grid strong.up { color: #23806d; }
.trend-stat-grid strong.down { color: #c55e4f; }
.trend-canvas-wrap {
  position: relative;
  width: 100%;
  height: 270px;
  margin-top: 18px;
  overflow: hidden;
}
#trendChart { width: 100%; height: 100%; display: block; }
.trend-legend { display: flex; align-items: center; gap: 15px; margin-top: 5px; color: #788682; font-size: 10px; }
.trend-legend span { display: inline-flex; align-items: center; gap: 5px; }
.trend-legend i { width: 16px; height: 3px; display: inline-block; border-radius: 4px; }
.trend-legend i.actual { background: var(--sea); }
.trend-legend i.target { height: 0; border-top: 2px dashed var(--high); }
.trend-legend em { margin-left: auto; color: #9aa5a2; font-style: normal; }
.trend-point-list {
  display: grid;
  grid-template-columns: repeat(7,minmax(48px,1fr));
  gap: 1px;
  margin-top: 14px;
  overflow-x: auto;
  border: 1px solid #e3e8e4;
  background: #e3e8e4;
}
.trend-point {
  min-width: 58px;
  padding: 8px 7px;
  background: #fbfcfa;
  text-align: center;
}
.trend-point span { display: block; color: #8c9895; font-size: 10px; }
.trend-point strong { display: block; margin-top: 4px; color: #385653; font-size: 11px; }
.trend-empty { padding: 28px 12px; color: #879591; font-size: 10px; text-align: center; }

@media (max-width: 900px) {
  .trend-browser { grid-template-columns: 1fr; }
  .trend-metric-list { max-height: 260px; }
}

@media (max-width: 720px) {
  .trend-section { margin-top: 38px; scroll-margin-top: 72px; }
  .trend-chart-card { padding: 18px 16px 15px; }
  .trend-chart-heading h3 { white-space: normal; }
  .trend-category-filter button { font-size: 8px; }
  .trend-stat-grid > div { padding: 10px; }
  .trend-stat-grid strong { font-size: 14px; }
  .trend-canvas-wrap { height: 235px; }
  .trend-legend em { display: none; }
}
