/* Analytics screen. Colours come from app.css tokens; the two lines are brand (views) and amber (taps). */
.an { --an-views: var(--brand); --an-taps: #D9960A; display: grid; gap: 24px; }   /* amber is fixed: the landing palette turns --redpen green */
.an[aria-busy="true"] { opacity: .6; transition: opacity .15s; }
.an-toolbar { display: flex; flex-wrap: wrap; align-items: center; gap: 12px 16px; }
.an-ranges { display: inline-flex; padding: 4px; gap: 4px; background: var(--surface); border: 1px solid var(--line); border-radius: 999px; }
.an-range { height: 36px; padding: 0 16px; white-space: nowrap; border: 0; border-radius: 999px; background: transparent; color: var(--ink); font: 600 14px/20px var(--f-ui); cursor: pointer; }
.an-range:hover { background: var(--tint); }
.an-range[aria-pressed="true"] { background: var(--brand); color: var(--on-brand); }
.an-range.is-locked { color: var(--ink-muted); cursor: not-allowed; }
.an-range.is-locked:hover { background: transparent; }
.an-hint { color: var(--ink-muted); font-size: 14px; }
.an-banner { margin: 0; padding: 12px 16px; border: 1px dashed var(--line-strong); border-radius: 12px; background: var(--tint); color: var(--ink); }
.an-stats { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; }
.an-stat { display: grid; gap: 4px; padding: 20px 24px; background: var(--surface); border: 1px solid var(--line); border-radius: 14px; }
.an-stat-label { color: var(--ink-muted); font: 600 12px/16px var(--f-ui); letter-spacing: .06em; text-transform: uppercase; }
.an-stat-value { font: 800 40px/44px var(--f-display); letter-spacing: -.02em; }
.an-stat-note { color: var(--ink-muted); font-size: 13px; line-height: 18px; }
.an-stat-note.up { color: var(--brand); font-weight: 600; }
.an-stat-note.down { color: var(--danger); font-weight: 600; }
.an-card { background: var(--surface); border: 1px solid var(--line); border-radius: 14px; padding: 24px; min-width: 0; }
.an-title { margin: 0 0 12px; font: 700 20px/26px var(--f-display); letter-spacing: -.01em; text-wrap: balance; }
.an-text { margin: 0 0 16px; max-width: 56ch; color: var(--ink-muted); font: 400 16px/24px var(--f-ui); }
.an-demo { overflow: hidden; background: var(--paper); border: 1px solid var(--line); border-radius: 20px; box-shadow: var(--shadow-lift, 0 18px 40px -24px rgba(22, 48, 42, .35)); text-align: left; }
.an-demo-bar { display: flex; justify-content: space-between; gap: 16px; padding: 12px 20px; background: var(--surface); border-bottom: 1px solid var(--line); color: var(--ink-muted); font: 500 13px/20px var(--f-mono); }
.an-demo .an { padding: 24px; }
.an-chart { position: relative; }
.an-chart svg { display: block; width: 100%; height: auto; overflow: visible; touch-action: pan-y; }
.an-chart .grid { stroke: var(--line); stroke-width: 1; }
.an-chart .lbl { fill: var(--ink-muted); font: 500 11px var(--f-mono); }
.an-chart .line { fill: none; stroke-width: 2.5; stroke-linejoin: round; stroke-linecap: round; }
.an-chart .line.views, .an-chart .dot.views, .an-key i.views { stroke: var(--an-views); background: var(--an-views); }
.an-chart .line.clicks, .an-chart .dot.clicks, .an-key i.clicks { stroke: var(--an-taps); background: var(--an-taps); }
.an-chart .dot { stroke-width: 0; }
.an-chart .dot.views { fill: var(--an-views); } .an-chart .dot.clicks { fill: var(--an-taps); }
.an-chart .cross { stroke: var(--line-strong); stroke-width: 1; stroke-dasharray: 3 3; }
.an-tip { position: absolute; top: 0; transform: translateX(-50%); padding: 6px 10px; border-radius: 8px; background: var(--ink); color: #fff; font: 600 12px/16px var(--f-ui); white-space: nowrap; pointer-events: none; }
.an-key { display: flex; gap: 16px; margin-top: 8px; color: var(--ink-muted); font-size: 13px; }
.an-key span { display: inline-flex; align-items: center; gap: 6px; }
.an-key i { width: 14px; height: 4px; border-radius: 2px; }
.an-bars { list-style: none; margin: 0; padding: 0; display: grid; gap: 14px; }
.an-bars li { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 4px 12px; }
.an-bar-name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-weight: 600; }
.an-bar-n { color: var(--ink-muted); font: 500 13px/20px var(--f-mono); }
.an-bar { grid-column: 1 / -1; display: block; height: 8px; border-radius: 4px; background: var(--tint); position: relative; }
.an-bar::after { content: ""; position: absolute; inset: 0 auto 0 0; width: var(--w); border-radius: 4px; background: var(--brand); }
.an-empty { margin: 0; color: var(--ink-muted); }
.an-trio { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; }
.an-locked { display: grid; justify-items: start; gap: 4px; }
.an-locked .an-text { margin-bottom: 12px; }
.an-foot { margin: 0; color: var(--ink-muted); font-size: 13px; }
@media (max-width: 760px) {
  .an-ranges { max-width: 100%; }
  .an-range { padding: 0 10px; flex: 1 1 auto; }
  .an-stats, .an-trio { grid-template-columns: minmax(0, 1fr); }
  .an-stat-value { font-size: 32px; line-height: 36px; }
}
@media (prefers-reduced-motion: reduce) { .an[aria-busy="true"] { transition: none; } }
