/* Ai ZaxBot — Analytics v2 (#view-analytics, rendered by js/analytics.js).
   Only the theme tokens from index.html :root are used, so every theme (minimal / light / dark / emerald / rose / amber)
   works. Spacing is on a 4/8px scale; numbers are tabular. */

#view-analytics {
  /* text colours mixed toward --ink so they stay readable on light AND dark cards */
  --an-good-t: color-mix(in srgb, var(--green) 62%, var(--ink));
  --an-bad-t: color-mix(in srgb, var(--red) 78%, var(--ink));
  --an-warn-t: color-mix(in srgb, var(--amber) 60%, var(--ink));
  --an-guess-t: color-mix(in srgb, var(--pink) 70%, var(--ink));
  /* series colours (fills) */
  --an-ai: var(--accent);
  --an-staff: var(--blue);
  --an-missed: var(--red);
  --an-won: var(--green);
  --an-lost: var(--red);
  --an-total: color-mix(in srgb, var(--accent) 55%, var(--card));
  --an-ret: color-mix(in srgb, var(--accent) 32%, var(--card));
}
.an { display: flex; flex-direction: column; gap: 16px; max-width: 1440px; margin: 0 auto; font-variant-numeric: tabular-nums; }
.an svg { flex: none; }
.an button, .an select, .an input { font: inherit; }
.an :focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.an-sr { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }
.an-muted { color: var(--muted); }

/* ---------- header ---------- */
.an-head { display: flex; align-items: flex-end; gap: 12px 16px; flex-wrap: wrap; }
.an-head-main { flex: 1; min-width: 0; }
.an-title { margin: 0; font-size: 22px; line-height: 1.3; font-weight: 700; letter-spacing: -.01em; color: var(--ink); }
.an-range { margin: 4px 0 0; font-size: 13px; color: var(--muted); }
.an-head-side { display: flex; align-items: center; gap: 12px; }
.an-updated { font-size: 12px; color: var(--muted); }
.an-updated.bad { color: var(--an-bad-t); }

/* ---------- buttons ---------- */
.an-btn { display: inline-flex; align-items: center; justify-content: center; gap: 6px; height: 36px; padding: 0 14px; border-radius: 10px; border: 1px solid var(--line2);
  background: var(--card); color: var(--ink); font-size: 13px; font-weight: 600; cursor: pointer; white-space: nowrap; text-decoration: none; transition: border-color .15s, background .15s; }
.an-btn:hover { border-color: var(--accent); background: var(--hover); }
.an-btn svg { width: 16px; height: 16px; }
.an-btn--sm { height: 32px; padding: 0 10px; font-size: 12.5px; }
.an-btn--sm svg { width: 14px; height: 14px; }
.an-btn--primary { background: var(--accent); border-color: transparent; color: #fff; }
.an-btn--primary:hover { background: color-mix(in srgb, var(--accent) 86%, var(--ink)); border-color: transparent; }
.an-btn--ghost { background: transparent; }
.an-btn.spin svg { animation: an-spin .9s linear infinite; }
@keyframes an-spin { to { transform: rotate(360deg); } }
.an-link { display: inline-flex; align-items: center; gap: 4px; min-height: 32px; padding: 0; border: 0; background: none; color: color-mix(in srgb, var(--accent) 80%, var(--ink)); font-size: 13px; font-weight: 600; cursor: pointer; }
.an-link svg { width: 14px; height: 14px; }
.an-link:hover { text-decoration: underline; }

/* ---------- filter bar ---------- */
.an-filters { display: flex; align-items: center; flex-wrap: wrap; gap: 8px 12px; padding: 10px 12px; border-radius: 14px; background: var(--card); border: 1px solid var(--line); box-shadow: var(--shadow); }
.an-filters-gap { flex: 1; }
.an-seg { display: inline-flex; padding: 3px; gap: 2px; border-radius: 11px; background: var(--card2); border: 1px solid var(--line); }
.an-seg button { height: 32px; padding: 0 12px; border: 0; border-radius: 8px; background: transparent; color: var(--muted); font-size: 13px; font-weight: 600; cursor: pointer; white-space: nowrap; }
.an-seg button:hover { color: var(--ink); }
.an-seg button[aria-checked="true"] { background: var(--card); color: var(--ink); box-shadow: 0 1px 3px rgba(0, 0, 0, .12); }
.an-custom { display: inline-flex; gap: 8px; flex-wrap: wrap; }
.an-custom[hidden] { display: none; }
.an-date { display: inline-flex; align-items: center; gap: 6px; font-size: 12.5px; color: var(--muted); }
.an-date input, .an-sel select { height: 36px; padding: 0 10px; border-radius: 10px; border: 1px solid var(--line2); background: var(--input); color: var(--ink); font-size: 13px; color-scheme: light dark; }
.an-sel select { max-width: 200px; cursor: pointer; }
.an-switch { position: relative; display: inline-flex; align-items: center; gap: 8px; min-height: 36px; font-size: 13px; font-weight: 600; color: var(--ink); cursor: pointer; user-select: none; }
.an-switch input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.an-switch-ui { position: relative; width: 34px; height: 20px; border-radius: 99px; background: var(--line2); transition: background .15s; flex: none; }
.an-switch-ui::after { content: ""; position: absolute; top: 2px; left: 2px; width: 16px; height: 16px; border-radius: 50%; background: #fff; box-shadow: 0 1px 2px rgba(0, 0, 0, .25); transition: transform .15s; }
.an-switch input:checked + .an-switch-ui { background: var(--accent); }
.an-switch input:checked + .an-switch-ui::after { transform: translateX(14px); }
.an-switch input:focus-visible + .an-switch-ui { outline: 2px solid var(--accent); outline-offset: 2px; }
.an-err { margin: -8px 0 0; font-size: 12.5px; color: var(--an-bad-t); }
.an-err[hidden] { display: none; }

/* ---------- tabs ---------- */
.an-tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--line); overflow-x: auto; scrollbar-width: none; }
.an-tabs::-webkit-scrollbar { display: none; }
.an-tabs button { flex: none; min-height: 42px; padding: 0 14px; border: 0; border-bottom: 2px solid transparent; margin-bottom: -1px; background: none; color: var(--muted); font-size: 14px; font-weight: 600; cursor: pointer; white-space: nowrap; }
.an-tabs button:hover { color: var(--ink); }
.an-tabs button[aria-selected="true"] { color: var(--ink); border-bottom-color: var(--accent); }
.an-panel { display: flex; flex-direction: column; gap: 16px; min-width: 0; transition: opacity .2s; }
.an-panel[aria-busy="true"] { opacity: .55; }
.an-panel:focus-visible { outline-offset: 4px; }

/* ---------- section head ---------- */
.an-sec-h { display: flex; align-items: flex-end; justify-content: space-between; gap: 8px 12px; flex-wrap: wrap; }
.an-sec-h h3 { margin: 0; font-size: 17px; font-weight: 700; color: var(--ink); }
.an-sec-h p { margin: 2px 0 0; font-size: 13px; color: var(--muted); }

/* ---------- KPI tiles ---------- */
.an-tiles { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; }
.an-tiles--5 { grid-template-columns: repeat(5, minmax(0, 1fr)); }
.an-tile { min-width: 0; display: flex; flex-direction: column; gap: 2px; padding: 14px 16px; border-radius: 14px; background: var(--card); border: 1px solid var(--line); box-shadow: var(--shadow); }
.an-tile-l { display: flex; align-items: center; flex-wrap: wrap; gap: 4px; font-size: 12.5px; font-weight: 600; color: var(--muted); }
.an-tile-v { font-family: Inter, "Noto Sans Thai", sans-serif; font-size: 26px; font-weight: 700; line-height: 1.2; letter-spacing: -.02em; color: var(--ink); margin: 4px 0 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.an-tile--bad .an-tile-v { color: var(--an-bad-t); }
.an-tile--warn .an-tile-v { color: var(--an-warn-t); }
.an-tile-s { font-size: 12px; line-height: 1.45; color: var(--muted); }
.an-tile-d { display: flex; align-items: center; flex-wrap: wrap; gap: 4px; margin-top: auto; padding-top: 8px; border-top: 1px solid var(--line); font-size: 12px; color: var(--muted); }
.an-tile > :nth-last-child(2):has(+ .an-tile-d) { margin-bottom: 8px; }
.an-tile-d svg { width: 13px; height: 13px; }
.an-tile-d b { font-weight: 700; }
.an-tile-d.good b, .an-tile-d.good svg { color: var(--an-good-t); }
.an-tile-d.bad b, .an-tile-d.bad svg { color: var(--an-bad-t); }
.an-tile-d.flat b { color: var(--ink); }

/* ---------- cards ---------- */
.an-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; align-items: start; }
.an-grid--why { grid-template-columns: minmax(0, 1.45fr) minmax(0, 1fr); }
.an-span2 { grid-column: 1 / -1; }
.an-card { min-width: 0; padding: 16px 18px; border-radius: 16px; background: var(--card); border: 1px solid var(--line); box-shadow: var(--shadow); }
.an-card-h { display: flex; align-items: flex-start; gap: 8px 12px; margin-bottom: 12px; }
.an-card-ht { flex: 1; min-width: 0; }
.an-card-h h3 { display: flex; align-items: center; flex-wrap: wrap; gap: 6px; margin: 0; font-size: 15px; font-weight: 700; color: var(--ink); }
.an-card-h p { margin: 4px 0 0; font-size: 12.5px; line-height: 1.5; color: var(--muted); }
.an-card--key { border-color: color-mix(in srgb, var(--accent) 35%, var(--line)); background: color-mix(in srgb, var(--accent) 4%, var(--card)); }
.an-h4 { margin: 14px 0 8px; font-size: 13px; font-weight: 700; color: var(--ink); }
.an-note { margin: 10px 0 0; font-size: 12px; line-height: 1.5; color: var(--muted); }
.an-note--guess { color: var(--an-guess-t); }
.an-tag { display: inline-flex; align-items: center; gap: 3px; height: 20px; padding: 0 7px; border-radius: 99px; font-size: 11px; font-weight: 600; letter-spacing: 0;
  color: var(--an-guess-t); background: color-mix(in srgb, var(--pink) 12%, var(--card)); border: 1px solid color-mix(in srgb, var(--pink) 25%, var(--line)); }
.an-tag svg { width: 11px; height: 11px; }
.an-count { display: inline-flex; align-items: center; height: 22px; padding: 0 8px; border-radius: 99px; font-size: 12px; font-weight: 700; color: var(--ink); background: var(--card2); border: 1px solid var(--line); white-space: nowrap; }
.an-count.bad { color: var(--an-bad-t); background: color-mix(in srgb, var(--red) 10%, var(--card)); border-color: color-mix(in srgb, var(--red) 25%, var(--line)); }
.an-count.warn { color: var(--an-warn-t); background: color-mix(in srgb, var(--amber) 12%, var(--card)); border-color: color-mix(in srgb, var(--amber) 28%, var(--line)); }
.an-chip { display: inline-flex; align-items: center; gap: 5px; height: 22px; padding: 0 8px; border-radius: 99px; font-size: 11.5px; font-weight: 600; color: var(--muted); background: var(--card2); border: 1px solid var(--line); white-space: nowrap; }
.an-chip--bad { color: var(--an-bad-t); border-color: color-mix(in srgb, var(--red) 28%, var(--line)); }
.an-chip--money { color: var(--ink); }
.an-chips { display: flex; flex-wrap: wrap; gap: 6px; }
.an-chan { display: inline-flex; align-items: center; gap: 6px; min-width: 0; }
.an-chan .chico { width: 18px; height: 18px; border-radius: 5px; flex: none; }

/* ---------- states ---------- */
.an-empty { display: flex; flex-direction: column; align-items: center; gap: 6px; padding: 24px 12px; text-align: center; color: var(--muted); }
.an-empty svg { width: 28px; height: 28px; color: var(--faint); }
.an-empty b { font-size: 14px; color: var(--ink); }
.an-empty p { margin: 0; max-width: 48ch; font-size: 12.5px; line-height: 1.55; }
.an-empty .an-btn { margin-top: 6px; }
.an-good { display: flex; align-items: center; gap: 8px; padding: 12px 14px; border-radius: 12px; font-size: 13.5px; font-weight: 600; color: var(--an-good-t);
  background: color-mix(in srgb, var(--green) 8%, var(--card)); border: 1px solid color-mix(in srgb, var(--green) 25%, var(--line)); }
.an-good svg { width: 18px; height: 18px; }
.an-state { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; padding: 16px; border-radius: 14px; background: var(--card); border: 1px solid var(--line); }
.an-state > div { flex: 1; min-width: 200px; }
.an-state svg { width: 24px; height: 24px; }
.an-state p { margin: 4px 0 0; font-size: 13px; color: var(--muted); }
.an-state--err { border-color: color-mix(in srgb, var(--red) 30%, var(--line)); color: var(--an-bad-t); }
.an-state--err b { color: var(--ink); }
.an-sk { border-radius: 14px; background: linear-gradient(90deg, var(--card2) 0%, var(--hover) 50%, var(--card2) 100%); background-size: 200% 100%; animation: an-sk 1.2s ease-in-out infinite; }
.an-sk--tile { height: 118px; }
.an-sk--card { height: 280px; }
@keyframes an-sk { from { background-position: 100% 0; } to { background-position: -100% 0; } }

/* ---------- why sales changed ---------- */
.an-why-text { margin: 0 0 12px; font-size: 15px; line-height: 1.7; font-weight: 500; color: var(--ink); }
.an-why-off { display: flex; flex-direction: column; align-items: flex-start; gap: 10px; padding: 4px 0 8px; }
.an-why-off p { margin: 0; font-size: 14px; line-height: 1.6; color: var(--muted); }
.an-sug { margin-top: 14px; padding-top: 14px; border-top: 1px solid var(--line); }
.an-sug h4 { display: flex; align-items: center; gap: 6px; margin: 0 0 10px; font-size: 13.5px; font-weight: 700; color: var(--ink); }
.an-sug h4 svg { width: 16px; height: 16px; color: var(--an-warn-t); }
.an-sug ol { margin: 0; padding: 0; list-style: none; counter-reset: an-sug; display: flex; flex-direction: column; gap: 8px; }
.an-sug li { counter-increment: an-sug; position: relative; padding: 10px 12px 8px 40px; border-radius: 12px; background: var(--card2); border: 1px solid var(--line); }
.an-sug li::before { content: counter(an-sug); position: absolute; left: 12px; top: 10px; width: 20px; height: 20px; border-radius: 50%; display: grid; place-items: center;
  font-size: 11.5px; font-weight: 700; color: #fff; background: var(--accent); }
.an-sug li p { margin: 0; font-size: 13.5px; line-height: 1.55; color: var(--ink); }

/* ---------- funnel ---------- */
.an-funnel { margin: 0; padding: 0; list-style: none; display: flex; flex-direction: column; gap: 2px; }
.an-fn-row { display: grid; grid-template-columns: 88px minmax(0, 1fr) 44px; align-items: center; gap: 10px; min-height: 30px; }
.an-fn-l { font-size: 13px; font-weight: 600; color: var(--ink); }
.an-fn-track { height: 20px; border-radius: 6px; background: var(--card2); overflow: hidden; }
.an-fn-fill { display: block; height: 100%; min-width: 2px; border-radius: 6px; background: color-mix(in srgb, var(--accent) 72%, var(--card)); }
.an-fn-fill.won { background: var(--green); }
.an-fn-v { text-align: right; font-size: 13px; font-weight: 700; color: var(--ink); }
.an-fn-conv { display: block; padding-left: 98px; font-size: 11px; line-height: 1.3; color: var(--faint); }

/* ---------- bars / legend / svg ---------- */
.an-hbars { margin: 0; padding: 0; list-style: none; display: flex; flex-direction: column; gap: 12px; }
.an-hb-top { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; font-size: 13px; }
.an-hb-l { min-width: 0; color: var(--ink); overflow-wrap: anywhere; }
.an-hb-v { flex: none; font-weight: 700; color: var(--ink); }
.an-hb-v small, .an-hb-l small { font-weight: 500; color: var(--muted); font-size: 11.5px; }
.an-hb-track { margin-top: 6px; height: 8px; border-radius: 99px; background: var(--card2); overflow: hidden; }
.an-hb-fill { display: block; height: 100%; min-width: 2px; border-radius: 99px; background: var(--accent); }
.an-hb-s { margin-top: 4px; font-size: 11.5px; color: var(--faint); }
.f-ai { background: var(--an-ai); } .f-staff { background: var(--an-staff); } .f-won { background: var(--an-won); } .f-lost { background: var(--an-lost); }
.f-warn { background: var(--amber); } .f-muted { background: var(--faint); }
.an-legend { display: flex; flex-wrap: wrap; gap: 6px 14px; margin: 0 0 8px; font-size: 12px; color: var(--muted); }
.an-legend span { display: inline-flex; align-items: center; gap: 6px; }
.an-sw { display: inline-block; width: 10px; height: 10px; border-radius: 3px; flex: none; }
.s-ai { fill: var(--an-ai); background: var(--an-ai); }
.s-staff { fill: var(--an-staff); background: var(--an-staff); }
.s-missed { fill: var(--an-missed); background: var(--an-missed); }
.s-won { fill: var(--an-won); background: var(--an-won); }
.s-lost { fill: var(--an-lost); background: var(--an-lost); }
.s-new { fill: var(--an-ai); background: var(--an-ai); }
.s-ret { fill: var(--an-ret); background: var(--an-ret); }
.s-muted { fill: var(--faint); background: var(--faint); }
.p-complaint { fill: var(--red); background: var(--red); }
.p-negative { fill: var(--pink); background: var(--pink); }
.p-sla { fill: var(--amber); background: var(--amber); }
.p-missed { fill: var(--accent); background: var(--accent); }
.p-gap { fill: var(--cyan); background: var(--cyan); }
.an-chart { width: 100%; min-width: 0; }
.an-svg { display: block; max-width: none; overflow: visible; }
.an-ax { fill: var(--muted); font-family: Inter, "Noto Sans Thai", sans-serif; font-size: 11px; }
.an-grid-l { stroke: var(--line); stroke-width: 1; }
.an-grid-l.zero { stroke: var(--line2); }
.an-hit { fill: transparent; }
.an-bar:hover .an-hit { fill: var(--hover); }
.an-chart--wf { margin: 4px 0 0; }
.an-wf-l { fill: var(--ink); font-family: "Noto Sans Thai", Inter, sans-serif; font-size: 12.5px; }
.an-wf-l.b { font-weight: 700; }
.an-wf-v { font-family: Inter, "Noto Sans Thai", sans-serif; font-size: 12.5px; font-weight: 700; fill: var(--ink); }
rect.wf-total { fill: var(--an-total); } rect.wf-pos { fill: var(--green); } rect.wf-neg { fill: var(--red); }
text.wf-pos { fill: var(--an-good-t); } text.wf-neg { fill: var(--an-bad-t); }
.wf-link { stroke: var(--line2); stroke-dasharray: 3 3; }

/* ---------- reply speed → close rate (key insight) ---------- */
.an-key-head { display: flex; align-items: flex-start; gap: 8px; margin: 0 0 16px; font-size: 15px; line-height: 1.55; font-weight: 700; color: var(--ink); }
.an-key-head svg { width: 20px; height: 20px; margin-top: 2px; color: var(--an-warn-t); }
.an-cols { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 10px; align-items: end; }
.an-col { display: flex; flex-direction: column; align-items: center; gap: 6px; min-width: 0; text-align: center; }
.an-col-v { font-size: 15px; font-weight: 700; color: var(--ink); }
.an-col-track { width: 100%; max-width: 72px; height: 140px; display: flex; align-items: flex-end; border-radius: 8px; background: var(--card2); overflow: hidden; }
.an-col-fill { display: block; width: 100%; border-radius: 8px 8px 0 0; background: color-mix(in srgb, var(--accent) 70%, var(--card)); }
.an-col-fill.fast { background: var(--green); }
.an-col-fill.none { background: var(--faint); }
.an-col-l { font-size: 12px; font-weight: 600; line-height: 1.35; color: var(--ink); }
.an-col-s { font-size: 11.5px; color: var(--muted); }

/* ---------- heatmap ---------- */
.an-mini-seg { display: inline-flex; padding: 2px; gap: 2px; border-radius: 9px; background: var(--card2); border: 1px solid var(--line); flex: none; }
.an-mini-seg button { height: 28px; padding: 0 10px; border: 0; border-radius: 7px; background: none; color: var(--muted); font-size: 12px; font-weight: 600; cursor: pointer; white-space: nowrap; }
.an-mini-seg button[aria-pressed="true"] { background: var(--card); color: var(--ink); box-shadow: 0 1px 3px rgba(0, 0, 0, .12); }
.an-heat-wrap { overflow-x: auto; padding-bottom: 4px; }
.an-hm { display: grid; grid-template-columns: 34px repeat(24, minmax(11px, 1fr)); gap: 2px; min-width: 330px; }
.an-hm-h { font-size: 10px; line-height: 14px; color: var(--faint); text-align: left; }
.an-hm-d { display: flex; align-items: center; font-size: 11px; color: var(--muted); }
.an-hm-c { --an-heat: var(--accent); height: 20px; border-radius: 3px; background: color-mix(in srgb, var(--an-heat) var(--a), var(--card2)); }
.an-hm-c.w { --an-heat: var(--amber); }
.an-hm-c.z { background: var(--card2); }
.an-hm-scale { display: flex; align-items: center; gap: 8px; margin-top: 10px; font-size: 11.5px; color: var(--muted); }
.an-hm-grad { display: inline-block; width: 96px; height: 8px; border-radius: 99px; background: linear-gradient(90deg, var(--card2), var(--accent)); }
.an-hm-grad.w { background: linear-gradient(90deg, var(--card2), var(--amber)); }

/* ---------- lists / tables ---------- */
.an-list { margin: 0; padding: 0; list-style: none; }
.an-list > li { display: flex; align-items: center; gap: 12px; padding: 10px 0; border-top: 1px solid var(--line); }
.an-list > li:first-child { border-top: 0; padding-top: 2px; }
.an-li-main { flex: 1; min-width: 0; }
.an-li-t { display: flex; align-items: center; flex-wrap: wrap; gap: 4px 8px; font-size: 13.5px; color: var(--ink); }
.an-li-t .an-muted { font-size: 12px; }
.an-li-s { margin: 4px 0 0; font-size: 12.5px; line-height: 1.5; color: var(--muted); overflow: hidden; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; word-break: break-word; }
.an-li-act { display: flex; gap: 6px; flex: none; }
.an-q { font-weight: 600; overflow-wrap: anywhere; }
.an-tablewrap { overflow-x: auto; margin: 0 -4px; padding: 0 4px; }
.an-table { width: 100%; border-collapse: collapse; font-size: 13px; }
.an-table th { padding: 6px 8px; text-align: left; font-size: 12px; font-weight: 600; color: var(--muted); border-bottom: 1px solid var(--line); white-space: nowrap; }
.an-table td { padding: 9px 8px; border-bottom: 1px solid var(--line); color: var(--ink); vertical-align: middle; }
.an-table tr:last-child td { border-bottom: 0; }
.an-table .num { text-align: right; white-space: nowrap; }
.an-table .act { text-align: right; width: 1%; white-space: nowrap; }

/* ---------- AI guesses + problems ---------- */
.an-guess { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
.an-guess-i { display: flex; align-items: center; gap: 8px; padding: 10px 12px; border-radius: 10px; background: var(--card2); border: 1px solid var(--line); font-size: 13px; color: var(--ink); }
.an-guess-i b { margin-left: auto; font-size: 15px; }
.an-mult { display: flex; flex-direction: column; }
.an-mult-row { display: grid; grid-template-columns: 190px minmax(0, 1fr); align-items: center; gap: 12px; padding: 8px 0; border-top: 1px solid var(--line); }
.an-mult-row:first-child { border-top: 0; padding-top: 0; }
.an-mult-l { display: flex; align-items: center; justify-content: space-between; gap: 8px; font-size: 13px; color: var(--ink); }
.an-mult-l span { display: inline-flex; align-items: center; gap: 6px; }
.an-mult-l b { font-size: 15px; }

/* ---------- responsive ---------- */
@media (max-width: 1280px) { .an-tiles--5 { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
@media (max-width: 1100px) { .an-tiles { grid-template-columns: repeat(2, minmax(0, 1fr)); } .an-tiles--5 { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
@media (max-width: 960px) { .an-grid, .an-grid--why { grid-template-columns: minmax(0, 1fr); } }
@media (max-width: 640px) {
  .an { gap: 12px; }
  .an-title { font-size: 19px; }
  .an-head-side { width: 100%; justify-content: space-between; }
  .an-filters { padding: 10px; }
  .an-seg { width: 100%; overflow-x: auto; }
  .an-seg button { flex: 1 0 auto; height: 38px; }
  .an-custom, .an-date { width: 100%; }
  .an-date input { flex: 1; min-width: 0; height: 40px; }
  .an-filters-gap { display: none; }
  .an-sel { flex: 1 1 140px; min-width: 0; }
  .an-sel select { width: 100%; max-width: none; height: 40px; }
  .an-btn, .an-btn--sm { min-height: 40px; }
  .an-link { min-height: 40px; }
  .an-mini-seg button { height: 36px; }
  .an-tiles, .an-tiles--5 { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
  .an-tile { padding: 12px; }
  .an-tile-v { font-size: 22px; }
  .an-card { padding: 14px; }
  .an-card-h { flex-wrap: wrap; }
  .an-list > li { flex-wrap: wrap; }
  .an-li-act { width: 100%; }
  .an-li-act .an-btn { flex: 1; }
  .an-cols { gap: 6px; }
  .an-col-track { height: 110px; }
  .an-col-l { font-size: 11px; }
  .an-mult-row { grid-template-columns: minmax(0, 1fr); gap: 6px; }
  .an-guess { grid-template-columns: minmax(0, 1fr); }
  .an-fn-row { grid-template-columns: 76px minmax(0, 1fr) 40px; }
  .an-fn-conv { padding-left: 86px; }
}
@media (prefers-reduced-motion: reduce) { .an-sk, .an-btn.spin svg { animation: none; } .an-panel, .an-switch-ui, .an-switch-ui::after { transition: none; } }
