.trends-frame { --pad: clamp(17px, 2.2vw, 32px); }
.trend-query { padding: 16px 18px 12px; margin-bottom: 18px; }
.trend-fields { display: grid; grid-template-columns: minmax(220px, 1.65fr) minmax(150px, .55fr) minmax(155px, .65fr); gap: 12px; }
.trend-search-field { width: 100%; min-height: 42px; }
.trend-filter, .trend-range, .trend-series label { display: flex; align-items: center; min-width: 0; gap: 8px; }
.trend-filter { padding: 0 11px; border: 1px solid var(--line); border-radius: 8px; }
.trend-filter span, .trend-series label span { font-size: 12px; font-weight: 600; color: var(--muted); flex-shrink: 0; }
.trends-frame select { max-width: 100%; min-width: 0; border: 1px solid #cbd8cd; border-radius: 7px; background: #fff; padding: 7px 5px; color: var(--ink); font-size: 13px; }
.trend-filter select { flex: 1; width: 100%; padding-inline-start: 2px; border: 0; }
.trend-examples { display: flex; align-items: center; flex-wrap: wrap; gap: 4px 7px; margin-top: 9px; }
.trend-examples span { color: var(--muted); margin-right: 2px; font-size: 12px; }
.trend-examples button { padding: 3px 8px; border: 1px solid #e0e8dc; border-radius: 5px; color: var(--green); background: #f5f8f2; font-size: 12px; line-height: 1.4; }
.trend-examples button:hover { background: #e7f0e4; border-color: #b5cdb9; }
.trend-workspace { display: grid; grid-template-columns: minmax(215px, .8fr) minmax(0, 2.65fr); align-items: start; gap: 18px; }
.trend-sidebar { min-width: 0; }
.trend-sidebar-head { padding: 17px 17px 12px; border-bottom: 1px solid var(--line); }
.trend-sidebar-head h2 { font-size: 17px; }
#result-summary { margin: 3px 0 0; color: var(--muted); font-size: 12px; overflow-wrap: anywhere; }
#trend-results { display: flex; flex-direction: column; overflow-y: auto; max-height: min(75vh, 720px); scrollbar-width: thin; }
.trend-place { display: block; position: relative; width: 100%; flex-shrink: 0; min-width: 0; padding: 11px 17px; text-align: left; border-bottom: 1px solid #e9eee7; color: var(--ink); }
.trend-place:hover { background: #f3f7f0; }
.trend-place strong, .trend-place small { display: block; overflow-wrap: anywhere; }
.trend-place strong { font-size: 14px; font-weight: 650; }
.trend-place small { color: var(--muted); font-size: 11px; margin-top: 1px; line-height: 1.5; }
.trend-place[aria-current="true"] { background: #eaf2e7; box-shadow: inset 3px 0 var(--green); }
.trend-place[aria-current="true"] strong { color: var(--deep); }
.trend-place:focus-visible { outline-offset: -3px; }
#more-results { color: var(--green); font-weight: 600; font-size: 13px; width: 100%; padding: 11px 14px; }
#more-results:hover { background: var(--wash); }
#trend-detail { min-width: 0; }
.trend-chart-block { padding: 19px var(--pad) 14px; }
.trend-detail-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
#trend-context { color: var(--muted); font-size: 12px; margin-bottom: 3px; }
#trend-name { font-size: clamp(23px, 2.15vw, 32px); font-weight: 670; overflow-wrap: anywhere; }
.trend-range { flex: 0 0 auto; }
.trend-range select { min-height: 36px; padding-inline-start: 9px; }
.trend-series { display: flex; flex-wrap: wrap; gap: 8px 16px; margin: 16px 0 6px; }
.trend-series label { flex: 1 1 175px; }
.trend-series select { width: 100%; flex: 1; text-overflow: ellipsis; }
#trend-coverage { color: var(--muted); font-size: 12px; margin: 8px 0 16px; line-height: 1.6; }
#monthly-chart .mc-readout { padding: 8px 11px; background: #f2f6f0; border-radius: 5px; }
.trend-record { padding: 19px var(--pad) 17px; border-top: 1px solid var(--line); }
#month-title { font-size: 17px; line-height: 1.45; font-weight: 650; }
#month-evidence { margin-top: 11px; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.month-metric { min-width: 0; padding: 11px 13px; border: 1px solid var(--line); border-radius: 8px; line-height: 1.55; overflow-wrap: anywhere; }
.month-metric h4 { margin: 0 0 4px; color: var(--muted); font-size: 12px; font-weight: 600; }
.month-metric strong { display: block; color: var(--deep); font-size: clamp(16px, 1.6vw, 22px); font-weight: 650; }
.month-metric:nth-child(2) strong { color: #81522d; }
.month-metric p, #other-records { color: var(--muted); font-size: 12px; }
.month-metric p { margin-top: 5px; }
.month-citations { margin: 6px 0 0; }
.month-citations a, #other-records a { overflow-wrap: anywhere; text-decoration: underline; text-underline-offset: 2px; }
.month-citations a + a { margin-inline-start: 6px; }
#additional-month { margin-top: 13px; border-top: 1px solid var(--line); padding-top: 10px; }
#additional-month summary { cursor: pointer; color: var(--green); font-weight: 600; font-size: 13px; width: fit-content; }
#other-records { margin-top: 8px; }
#other-records > * + * { margin-top: 7px; }
#other-records ul { padding-inline-start: 20px; }
.trend-empty-panel { min-height: 265px; display: grid; align-content: center; justify-items: center; gap: 7px; text-align: center; color: var(--muted); padding: 20px; }
.trend-empty-panel .icon { width: 25px; height: 25px; color: var(--green); }
.trend-empty-panel h2 { font-size: 18px; color: var(--ink); }
.trend-empty-panel p { font-size: 14px; }
@media (max-width: 900px) {
  .trend-workspace { grid-template-columns: minmax(165px, .68fr) minmax(0, 2fr); gap: 12px; }
}
@media (max-width: 760px) {
  .trends-frame { --pad: 15px; }
  .trend-heading { gap: 5px; align-items: flex-start; flex-wrap: wrap; padding: 13px 0 11px; }
  .trend-heading p { font-size: 12px; margin-top: 4px; }
  .trend-heading .report-date { font-size: 11px; }
  .trend-query { margin-bottom: 10px; padding: 10px 11px; }
  .trend-fields { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 6px; }
  .trend-search-field { grid-column: 1 / -1; min-height: 37px; }
  .trend-search-field input { padding: 8px 0; }
  .trend-filter { gap: 4px; padding-inline: 6px; }
  .trend-filter select { padding-block: 4px; }
  .trend-workspace { display: flex; flex-direction: column; align-items: stretch; gap: 10px; }
  .trend-sidebar { display: grid; grid-template-columns: minmax(0, 1fr) auto; }
  .trend-sidebar-head { grid-column: 1; grid-row: 1; display: flex; flex-wrap: wrap; align-items: baseline; gap: 3px 8px; padding: 8px 12px 4px; border: 0; }
  .trend-sidebar-head h2 { font-size: 14px; }
  #result-summary { font-size: 11px; margin: 0; }
  #trend-results { grid-row: 2; grid-column: 1 / -1; flex-direction: row; overflow-x: auto; max-height: none; padding: 2px 10px 6px; gap: 5px; }
  .trend-place { width: auto; min-width: 94px; max-width: 185px; border: 1px solid var(--line); border-radius: 5px; padding: 4px 8px; }
  .trend-place strong { font-size: 13px; }
  .trend-place small { font-size: 10px; }
  .trend-place[aria-current="true"] { box-shadow: none; border-color: #89ab91; }
  #more-results { grid-column: 2; grid-row: 1; width: auto; padding: 4px 10px; font-size: 11px; }
  .trend-chart-block { padding-top: 14px; }
  .trend-series { margin-top: 10px; gap: 5px 10px; }
  #trend-coverage { margin: 5px 0 10px; }
  .trend-record { padding-top: 13px; }
}
@media (max-width: 520px) {
  .trend-series { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .trend-series label { display: block; }
  .trend-series label span { display: block; margin-bottom: 3px; }
  .trend-series select { padding: 5px 2px; }
  .trend-heading { display: block; }
  .trend-heading .report-date { margin-top: 4px; }
  .trend-examples { gap: 4px; }
  .trend-examples button { padding: 3px 6px; }
  #month-evidence { grid-template-columns: 1fr; }
}
@media (max-width: 395px) {
  .bar-inner .main-nav { gap: 10px; }
  .bar-inner .main-nav a { gap: 3px; }
  .bar-inner .main-nav .icon { display: none; }
}
@media (max-width: 345px) {
  .trends-frame { --pad: 9px; }
}
