/* The trends report on top of Searchscape's own look (static/look/app.css, Alex 2026-11-14: both apps
   look alike, in the original Searchscape style). Only what the report needs, in Searchscape's colours:
   ink for the line, lime under it, pink for growth from a doubling, lime for a new search. */
/* Rising's own colours on the shared look (Alex 2026-11-14: same feel, not the same colours): a sunrise
   orange and amber in place of Searchscape's pink and lime. Fonts, paper, ink and shapes stay shared */
:root {
  --color-accent: oklch(60% 0.19 40); --color-accent-deep: oklch(52% 0.18 38); --color-accent-2: oklch(84% 0.15 75);
  --color-slot: oklch(95% 0.03 70); --color-focus: oklch(60% 0.19 40);
}
.sibling { --sibling-color: oklch(87.6% 0.179 119); }
:root {
  --line: var(--color-ink);             /* the 3-month average, one series per chart */
  --line-area: color-mix(in oklch, var(--color-accent-2) 45%, transparent);
  --fast: var(--color-accent);
  --grew: var(--color-ink);             /* growth bands: under 2x, from 2x, from 3x */
  --doubled: var(--color-accent);
  --tripled: var(--color-accent-deep);
  --new: var(--color-accent-2);         /* a new trend, from almost no searches (2026-11-12) */
}
.phrase .count { white-space: nowrap; }
.brand .rise { color: var(--color-accent); }

/* The report: one section per topic, a card per trend with its line */
.report { margin-top: var(--space-xl); display: grid; gap: var(--space-2xl); }
.report-head { display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; gap: var(--space-sm); }
.report-note { color: var(--color-muted); font-size: var(--text-sm); max-width: 60ch; }
.topic-nav { display: flex; flex-wrap: wrap; gap: var(--space-xs); margin-top: var(--space-md); }
.topic-nav a { font-size: var(--text-sm); font-weight: 700; text-decoration: none; padding: var(--space-2xs) var(--space-sm); border-radius: var(--radius-pill); box-shadow: inset 0 0 0 1px var(--color-rule); background: var(--color-card); }
.topic-nav a:hover { box-shadow: inset 0 0 0 1px var(--color-ink); }
.topic h2 { font-size: var(--text-2xl); max-width: none; }
.topic > p { color: var(--color-ink-2); margin-top: var(--space-2xs); max-width: 70ch; }
.topic small { font-family: var(--font-body); font-size: var(--text-sm); font-weight: 600; color: var(--color-muted); margin-left: var(--space-xs); letter-spacing: 0; }
.cards { margin-top: var(--space-md); display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 290px), 1fr)); gap: var(--space-md); }
.trend { padding: var(--space-md); display: flex; flex-direction: column; gap: var(--space-xs); min-width: 0; }
.trend-term { font-weight: 700; font-size: var(--text-md); line-height: 1.3; overflow-wrap: anywhere; }
.trend-meta { display: flex; flex-wrap: wrap; align-items: baseline; gap: var(--space-2xs) var(--space-sm); font-size: var(--text-sm); color: var(--color-muted); }
.trend-meta .up { font-family: var(--font-display); font-size: var(--text-xl); font-weight: 700; color: var(--color-ink); font-variant-numeric: tabular-nums; }
.trend-meta .up.grew { color: var(--grew); }
.trend-meta .up.doubled, .trend-meta .up.tripled { display: inline-flex; align-items: center; gap: 6px; padding: 0 var(--space-sm); border-radius: var(--radius-pill); box-shadow: inset 0 0 0 2px var(--doubled); }
.trend-meta .up.doubled::before, .trend-meta .up.tripled::before { content: ""; width: 8px; height: 8px; border-radius: 50%; background: var(--doubled); }
.trend-meta .up.tripled { background: var(--tripled); box-shadow: none; color: var(--color-accent-ink); }
.trend-meta .up.tripled::before { background: var(--color-accent-ink); }
.growth-key { margin-top: var(--space-xs); display: flex; flex-wrap: wrap; gap: var(--space-xs) var(--space-md); font-size: var(--text-xs); color: var(--color-ink-2); }
.growth-key .key { display: inline-flex; align-items: center; gap: 6px; }
.growth-key .key::before { content: ""; width: 12px; height: 12px; border-radius: 50%; }
.growth-key .grew::before { background: var(--grew); }
.growth-key .doubled::before { box-shadow: inset 0 0 0 2px var(--doubled); }
.growth-key .tripled::before { background: var(--tripled); }
.badge { display: inline-flex; align-items: center; gap: 4px; font-size: var(--text-xs); font-weight: 700; padding: 1px var(--space-xs); border-radius: var(--radius-pill); color: var(--color-ink); box-shadow: inset 0 0 0 1.5px var(--fast); }
.badge::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: var(--fast); }
.trend-explain { font-size: var(--text-sm); color: var(--color-ink-2); }
.trend-variants { font-size: var(--text-xs); color: var(--color-muted); }
.chart { position: relative; margin-top: auto; }
.chart svg { width: 100%; height: auto; overflow: visible; }
.chart .area { fill: var(--line-area); }
.chart .ln { fill: none; stroke: var(--line); stroke-width: 2; stroke-linejoin: round; stroke-linecap: round; }
.chart .base { stroke: var(--color-rule); stroke-width: 1; }
.chart .yr { fill: var(--color-muted); font-size: 10px; font-family: var(--font-body); }
.chart .hair { stroke: var(--color-ink); stroke-width: 1; stroke-dasharray: 2 2; }
.chart .dot { fill: var(--line); stroke: var(--color-card); stroke-width: 2; }
.tip { position: absolute; top: -6px; transform: translate(-50%, -100%); pointer-events: none; white-space: nowrap; font-size: var(--text-xs); font-weight: 600; padding: 3px 8px; border-radius: 8px; background: var(--color-fill-ink); color: var(--color-white); }
.more { margin-top: var(--space-md); }
.more summary { cursor: pointer; font-weight: 700; font-size: var(--text-sm); }
.more ul { margin: var(--space-xs) 0 0; padding-left: 1.2em; columns: 2 16rem; font-size: var(--text-sm); }
.table-toggle { font-size: var(--text-sm); }
.how-trend { padding: var(--space-lg); }
.how-trend h2 { font-size: var(--text-lg); }
.how-trend p { margin-top: var(--space-2xs); color: var(--color-ink-2); }

/* Comparable charts (review 2026-11-08): the last 12 months shaded, the first and last values on the line */
.chart .last12 { fill: var(--color-ink); opacity: 0.05; }
.chart .val { fill: var(--color-muted); font-size: 10px; font-weight: 700; font-family: var(--font-body); font-variant-numeric: tabular-nums; }
.chart .val.end { fill: var(--color-ink); }

/* Keep the result: the download of every trend and the print button */
.keep { display: flex; flex-wrap: wrap; gap: var(--space-sm); margin-bottom: var(--space-md); }
.keep a.primary { text-decoration: none; display: inline-flex; align-items: center; }

@media print {
  body { background: none; }
  .top, .build-grid, .saved, .keep, .phrases-title, .done-list, .topic-nav, .tip, .chart .hair, .chart .dot { display: none !important; }
  .trend, .how-trend { break-inside: avoid; box-shadow: none; }
  .cards { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .more[open] ul, .more ul { display: block; }
}

/* Trend types as filters and a choice of order (2026-11-12) */
.trend-controls { margin-top: var(--space-md); padding: var(--space-sm); border-radius: var(--radius-card); background: var(--color-card); box-shadow: inset 0 0 0 1px var(--color-rule); display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: var(--space-sm); }
.trend-controls .filters { display: flex; flex-wrap: wrap; align-items: center; gap: var(--space-xs); }
.trend-controls .ctl-label { font-size: var(--text-sm); color: var(--color-ink-2); margin-right: var(--space-2xs); }
.trend-controls .chip { font: inherit; font-size: var(--text-sm); font-weight: 700; cursor: pointer; color: var(--color-ink); padding: var(--space-2xs) var(--space-sm); border: 0; border-radius: var(--radius-pill); box-shadow: inset 0 0 0 1px var(--color-rule); background: var(--color-paper); }
.trend-controls .chip small { font-weight: 400; color: var(--color-muted); margin-left: 4px; }
.trend-controls .chip:hover { box-shadow: inset 0 0 0 1px var(--color-ink); }
.trend-controls .chip.on { background: var(--color-ink); color: var(--color-paper); box-shadow: none; }
.trend-controls .chip.on small { color: inherit; opacity: 0.8; }
.trend-controls .sort { font-size: var(--text-sm); color: var(--color-ink-2); display: inline-flex; align-items: center; gap: var(--space-xs); }
.trend-controls select { font: inherit; font-size: var(--text-sm); padding: var(--space-2xs) var(--space-sm); border-radius: var(--radius-pill); border: 1px solid var(--color-rule); background: var(--color-card); color: var(--color-ink); }
.trend-meta .up.new { font-size: var(--text-md); display: inline-flex; align-items: center; padding: 0 var(--space-sm); border-radius: var(--radius-pill); background: var(--new); color: var(--color-fill-ink); box-shadow: inset 0 0 0 2px var(--color-fill-ink); }
.trend-tags { display: flex; gap: var(--space-2xs); margin-top: 2px; }
.trend-tags .tag { font-size: var(--text-xs); font-weight: 700; padding: 0 var(--space-xs); border-radius: var(--radius-pill); box-shadow: inset 0 0 0 1px var(--color-rule); color: var(--color-ink-2); }
.growth-key .new::before { background: var(--new); }
@media print { .trend-controls { display: none !important; } }
