/* «Аналитика ассистента» (views/assistant-analytics.mjs). Prefix aa-: the owner's ad blocker hides .ad-* blocks. */
/* Tokens on body: the modal (#detail) with the operator summary lives outside the page container. */
body{--aa-full:var(--accent);--aa-partial:var(--purple);--aa-none:color-mix(in srgb,var(--red) 50%,var(--surface));--aa-as_is:#1f4f8f;--aa-edited:#3b7dd8;--aa-similar:#a9c9f0;--aa-track:color-mix(in srgb,var(--line) 70%,var(--surface));--aa-warn-bg:#fbf3e4;--aa-warn-line:#ecd3a6;--aa-warn-ink:#5a3d0d}
body.dark{--aa-none:color-mix(in srgb,var(--red) 60%,var(--surface));--aa-as_is:#7fa6e8;--aa-edited:#4b8be0;--aa-similar:#2c5a92;--aa-warn-bg:color-mix(in srgb,var(--amber) 14%,var(--surface));--aa-warn-line:color-mix(in srgb,var(--amber) 40%,var(--line));--aa-warn-ink:var(--text)}
.aa-page .aa-slot:empty{display:none}
.aa-page .aa-slot+.aa-slot,.aa-page .aa-row+.aa-slot,.aa-page .aa-slot+.aa-row,.aa-page .aa-slot+.aa-how{margin-top:16px}
.aa-page .aa-row{display:flex;flex-wrap:wrap;gap:16px;margin-top:16px}
.aa-page .aa-row>.aa-slot{margin:0;min-width:0}
.aa-page .aa-row>#aa-hero{flex:2 1 520px}
.aa-page .aa-row>#aa-funnel{flex:1 1 320px}
.aa-page .aa-row>.aa-slot>.aa-card{height:100%}
.aa-card{padding:22px 24px;display:flex;flex-direction:column;gap:14px}
.aa-card h2{margin:0;font-size:16px;font-weight:650;letter-spacing:-.15px}
.aa-head{display:flex;flex-direction:column;gap:2px}
.aa-head .sub{font-size:13px}
.aa-head-row{flex-direction:row;flex-wrap:wrap;align-items:center;justify-content:space-between;gap:12px}
.aa-muted{color:var(--muted)}
.aa-small{font-size:12px}
.aa-strong{font-weight:600}
.aa-ink{color:var(--text)}
.aa-big{font-size:18px;font-variant-numeric:tabular-nums}
.aa-num{font-size:24px;font-variant-numeric:tabular-nums}
.aa-note{margin:0;color:var(--muted);font-size:12px}
.aa-eyebrow{font-size:12px;font-weight:600;color:var(--muted);text-transform:uppercase;letter-spacing:.05em}
.aa-filter{padding:0 0 14px;align-items:center}
.aa-meta{margin-left:auto}
/* Colors of the outcomes and of the ways the hint was used. */
.aa-full{background:var(--aa-full)}.aa-partial{background:var(--aa-partial)}.aa-none{background:var(--aa-none)}
.aa-as_is{background:var(--aa-as_is)}.aa-edited{background:var(--aa-edited)}.aa-similar{background:var(--aa-similar)}
.aa-swatch{display:inline-block;flex:none;width:11px;height:11px;border-radius:3px;vertical-align:-1px}
.aa-bar{display:flex;height:14px;border-radius:7px;overflow:hidden;background:var(--aa-track);gap:2px}
.aa-bar i{display:block;min-width:3px}
.aa-bar-lg{height:16px;border-radius:8px}
.aa-bar-sm{height:8px;width:140px;border-radius:4px;gap:0}
.aa-bar-sm i{min-width:0}
/* Banners: the period is still checked, or judged by another version of the check. */
.aa-banner{display:flex;flex-wrap:wrap;align-items:center;gap:10px 16px;padding:13px 16px;border-radius:12px;border:1px solid var(--line);border-left:3px solid var(--accent);background:color-mix(in srgb,var(--accent) 6%,var(--surface));line-height:1.5}
.aa-banner>span{flex:1 1 320px}
.aa-banner.aa-warn{background:var(--aa-warn-bg);border-color:var(--aa-warn-line);border-left-color:var(--amber);color:var(--aa-warn-ink)}
/* Hero. */
.aa-hero-top{display:flex;flex-wrap:wrap;align-items:flex-end;gap:10px 28px}
.aa-hero-num{display:flex;flex-direction:column;gap:2px}
.aa-hero-num b{font-size:68px;line-height:1;font-weight:700;letter-spacing:-.02em;font-variant-numeric:tabular-nums}
.aa-hero-lead{margin:0;padding-bottom:6px;font-size:15px;max-width:440px}
.aa-legend{display:flex;flex-wrap:wrap;gap:12px}
.aa-legend-item{flex:1 1 170px;display:flex;gap:10px;align-items:flex-start}
.aa-legend-item .aa-swatch{margin-top:6px}
/* «Откуда N». */
.aa-funnel{gap:9px}
.aa-frow{display:flex;justify-content:space-between;align-items:flex-start;gap:12px;font-variant-numeric:tabular-nums}
.aa-frow>span{min-width:0}
.aa-frow small{display:block;font-size:12px;color:var(--muted)}
.aa-frow>b{white-space:nowrap}
.aa-ftotal{border-top:1px solid var(--line);padding-top:10px;color:var(--text)}
/* How the hint was used. */
.aa-uses{display:flex;flex-wrap:wrap;gap:12px}
.aa-use{flex:1 1 220px;padding:14px 16px;background:var(--soft);border-radius:12px;display:flex;flex-direction:column;gap:4px}
.aa-use-title{display:flex;align-items:center;gap:8px}
/* Tables: the matrix and the operators. */
.aa-table{overflow-x:auto}
.aa-table table{width:100%;border-collapse:collapse}
.aa-table th,.aa-table td{padding:9px 12px;text-align:right;font-size:13px;font-variant-numeric:tabular-nums;white-space:nowrap;border-bottom:1px solid var(--line)}
.aa-table thead th{font-size:12px;text-transform:none;letter-spacing:0;font-weight:600;color:var(--muted);background:transparent}
.aa-table th[scope=row],.aa-table thead th:first-child{text-align:left}
.aa-table th[scope=row]{font-weight:600;color:var(--text);background:transparent;text-transform:none;letter-spacing:0}
.aa-table th[scope=row] .aa-swatch{margin-right:8px}
.aa-table .aa-left{text-align:left}
.aa-table tbody tr{cursor:default}
.aa-table tbody tr:last-child>*{border-bottom:0}
.aa-table .aa-total>*{border-top:1px solid var(--line)}
.aa-table .aa-current{background:color-mix(in srgb,var(--accent) 8%,var(--surface))}
.aa-cell,.aa-link{border:0;background:none;padding:0;font:inherit;color:var(--accent);text-decoration:underline;text-decoration-color:color-mix(in srgb,var(--accent) 40%,transparent);text-underline-offset:3px;cursor:pointer}
.aa-cell:hover,.aa-link:hover{text-decoration-color:currentColor}
.aa-link{font-weight:600;text-align:left}
.aa-helped{display:flex;align-items:center;gap:10px}
.aa-helped b{width:52px;text-align:right}
/* Daily chart: stacked share of «помог»; weekends lighter. */
.aa-toggle{display:flex;gap:4px;border:1px solid var(--line);padding:3px;border-radius:9px;background:var(--surface)}
.aa-toggle button{border:0;background:transparent;padding:6px 12px;border-radius:6px;color:var(--muted);font-size:12px;min-height:32px}
.aa-toggle button[aria-pressed=true]{background:var(--text);color:var(--surface);font-weight:600}
.aa-chart-legend{display:flex;flex-wrap:wrap;gap:6px 16px;font-size:12px;color:var(--muted)}
.aa-chart-legend span{display:flex;align-items:center;gap:6px}
.aa-chart{display:flex;gap:8px}
.aa-axis{display:flex;flex-direction:column;justify-content:space-between;height:180px;width:36px;flex:none;font-size:12px;color:var(--muted);text-align:right}
.aa-plot-wrap{flex:1 1 auto;min-width:0;overflow-x:auto}
.aa-plot{display:flex;align-items:stretch;gap:4px;height:180px;min-width:calc(var(--aa-cols) * 12px);border-bottom:1px solid var(--line);background:linear-gradient(var(--aa-track) 1px,transparent 1px) 0 0/100% 90px}
.aa-col{flex:1 1 0;display:flex;flex-direction:column;justify-content:flex-end;min-width:6px}
.aa-col i{display:block}
.aa-col .aa-partial{border-radius:3px 3px 0 0}
.aa-col.aa-weekend{opacity:.5}
.aa-col:hover{filter:brightness(1.08)}
.aa-xlabels{display:flex;gap:4px;min-width:calc(var(--aa-cols) * 12px);padding-top:6px;font-size:12px;color:var(--muted)}
.aa-xlabels span{flex:1 1 0;min-width:6px;text-align:center;white-space:nowrap;overflow:visible}
/* «Как считаем». */
.aa-how ol{margin:0;padding-left:20px;display:flex;flex-direction:column;gap:8px}
/* Modal: operator summary and the dialogs behind a number. */
.aa-op{display:flex;flex-direction:column;gap:14px}
.aa-op-lead{margin:0;color:var(--muted)}
.aa-op-lead b{color:var(--text)}
.aa-tiles{display:grid;grid-template-columns:repeat(auto-fit,minmax(125px,1fr));gap:10px}
.aa-tile{border:1px solid var(--line);border-radius:12px;padding:14px;display:flex;flex-direction:column;gap:2px;background:var(--surface)}
.aa-tile span{font-size:12px;font-weight:600;color:var(--muted)}
.aa-tile b{font-size:28px;line-height:1.15;font-variant-numeric:tabular-nums}
.aa-tile small{font-size:12px;color:var(--muted)}
.aa-sub{display:flex;flex-direction:column;gap:8px;border:1px solid var(--line);border-radius:12px;padding:14px 16px}
.aa-sub h3{margin:0;font-size:14px;font-weight:650}
.aa-sub .aa-frow{padding:6px 0;border-bottom:1px solid var(--line)}
.aa-sub .aa-frow:last-child{border-bottom:0}
.aa-inline{display:flex;flex-wrap:wrap;gap:6px 20px;color:var(--muted);font-size:13px}
.aa-inline b{color:var(--text)}
.aa-review{display:flex;gap:12px;align-items:flex-start;padding:8px 0;border-bottom:1px solid var(--line)}
.aa-review:last-child{border-bottom:0}
.aa-score{flex:none;width:42px;height:42px;border-radius:10px;display:grid;place-items:center;font-size:15px;background:var(--soft)}
.aa-score.aa-good{background:var(--tint);color:var(--accent)}
.aa-score.aa-mid{background:color-mix(in srgb,var(--amber) 14%,var(--surface));color:var(--amber)}
.aa-score.aa-bad{background:color-mix(in srgb,var(--red) 12%,var(--surface));color:var(--red)}
/* Drill lists (this page and assistant-analytics-effect.mjs share the markup). */
.aa-drill-list{list-style:none;margin:12px 0 0;padding:0;border-top:1px solid var(--line)}
.aa-drill-row{display:flex;flex-wrap:wrap;align-items:center;gap:8px 14px;padding:12px 0;border-bottom:1px solid var(--line)}
.aa-drill-main{flex:1 1 300px;min-width:0;display:flex;flex-direction:column;gap:2px}
.aa-hint{color:var(--muted);font-size:12px}
.aa-drill-foot{display:flex;flex-wrap:wrap;justify-content:space-between;align-items:center;gap:10px;margin-top:12px}
.aa-drill-actions{display:flex;gap:8px}
@media(max-width:700px){
  .aa-card{padding:16px}
  .aa-hero-num b{font-size:52px}
  .aa-meta{margin-left:0;flex-basis:100%}
  .aa-axis{width:30px}
}
@media print{.aa-toggle,.aa-drill-actions{display:none}.aa-col.aa-weekend{opacity:.6}}

/* Причины и эффект (assistant-analytics-effect.mjs) */
/* Sections .aa-section.aa-reasons / .aa-section.aa-effect and the drill .aa-drill in #detail. Shared names
   (.aa-tiles, .aa-tile, .aa-head, .aa-bar, .aa-link, .aa-hint, .aa-good, .aa-bad) are scoped here, never redefined. */
.aa-section{background:var(--surface);border:1px solid var(--line);border-radius:13px;box-shadow:var(--shadow);padding:22px 24px;display:flex;flex-direction:column;gap:12px;min-width:0}
.aa-section .aa-head h2{margin:0;font-size:16px;font-weight:650;letter-spacing:-.15px}
.aa-section .aa-head .sub b{color:var(--text)}
.aa-section .aa-hint{font-size:13px}
.aa-section .aa-good{color:var(--accent)}
.aa-section .aa-bad{color:var(--red)}
.aa-section .aa-reason-list,.aa-section .aa-subrows{display:flex;flex-direction:column}
.aa-section .aa-reason{display:flex;flex-wrap:wrap;align-items:center;gap:8px 16px;padding:12px 8px;min-height:44px;width:100%;box-sizing:border-box;border:0;border-bottom:1px solid var(--line);border-radius:0;background:none;color:var(--text);text-align:left;font:inherit}
.aa-section button.aa-reason{cursor:pointer}
.aa-section button.aa-reason:hover{background:var(--soft)}
.aa-section .aa-reason-main{flex:1 1 300px;min-width:0}
.aa-section .aa-reason-sub{padding-left:28px;font-size:13px}
.aa-section .aa-reason-sub .aa-reason-main{flex-basis:260px}
.aa-section .aa-tag{display:inline-block;margin-left:6px;padding:0 8px;border-radius:999px;font-size:12px;font-weight:600;white-space:nowrap}
.aa-section .aa-tag-log{background:var(--tint);color:var(--accent)}
.aa-section .aa-tag-ai{background:color-mix(in srgb,var(--purple) 14%,var(--surface));color:var(--purple)}
.aa-section .aa-reason .aa-bar{display:block;flex:0 1 220px;height:8px;border-radius:4px;gap:0;background:var(--aa-track,var(--soft));overflow:hidden}
.aa-section .aa-reason .aa-bar i{display:block;height:100%;min-width:0;background:color-mix(in srgb,var(--red) 55%,var(--surface))}
.aa-section .aa-reason-sub .aa-bar i{background:color-mix(in srgb,var(--purple) 45%,var(--surface))}
.aa-section .aa-count{min-width:110px;text-align:right;font-variant-numeric:tabular-nums}
.aa-section .aa-reason-sub .aa-count{min-width:170px}
.aa-section .aa-chevron{flex:none;color:var(--muted)}
.aa-section .aa-chevron-gap{flex:none;width:16px}
.aa-section .aa-subnote{display:block;padding:6px 8px 6px 28px}
.aa-section .aa-link{font-size:13px;font-weight:500}
.aa-section .aa-tiles{display:flex;flex-wrap:wrap;gap:12px}
.aa-section .aa-tile{flex:1 1 260px;min-width:0;padding:16px;gap:4px}
.aa-section .aa-tile-label{color:var(--muted);font-weight:600;font-size:13px}
.aa-section .aa-tile-value{font-size:28px;line-height:1.2;font-variant-numeric:tabular-nums}
.aa-section .aa-tile-foot{color:var(--muted);font-weight:400;font-size:13px}
.aa-section .aa-h3{margin:6px 0 0;font-size:15px;font-weight:600}
.aa-section .aa-due{margin:0}
.aa-section .aa-table-wrap{overflow-x:auto;max-width:100%}
.aa-section .aa-cmp{border-collapse:collapse;width:100%}
.aa-section .aa-cmp th,.aa-section .aa-cmp td{padding:8px 12px;border-bottom:1px solid var(--line);font-size:13px;text-align:right;white-space:nowrap;text-transform:none;letter-spacing:0;background:none;font-variant-numeric:tabular-nums}
.aa-section .aa-cmp thead th{font-size:12px;font-weight:600;color:var(--muted)}
.aa-section .aa-cmp th[scope=row]{text-align:left;font-weight:500;color:var(--text)}
.aa-section .aa-cmp thead th:first-child,.aa-section .aa-cmp thead th:last-child,.aa-section .aa-cmp .aa-diff{text-align:left}
.aa-section .aa-cmp tbody tr{cursor:default}
.aa-section .aa-cmp tbody tr:hover{background:none}
.aa-section .aa-cmp tbody tr:last-child>*{border-bottom:0}
.aa-section .aa-foot{font-size:13px}
.aa-section .aa-actions{display:flex;flex-wrap:wrap;gap:8px}
.aa-drill{display:flex;flex-direction:column;gap:12px}
.aa-drill .aa-kicker{margin:0;font-size:13px;font-weight:600;color:var(--muted);text-transform:uppercase;letter-spacing:.04em}
.aa-drill .aa-drill-list{margin:0}
.aa-drill .aa-drill-main{overflow-wrap:anywhere}
.aa-drill .aa-drill-link{min-height:36px;display:inline-flex;align-items:center}
@media(max-width:700px){
  .aa-section{padding:16px}
  .aa-section .aa-reason .aa-bar{flex-basis:100%}
  .aa-section .aa-count,.aa-section .aa-reason-sub .aa-count{min-width:0;text-align:left}
  .aa-section .aa-reason-sub,.aa-section .aa-subnote{padding-left:12px}
  .aa-section .aa-tile{flex-basis:100%}
}
/* Рейтинг (10.10): операторы с малым числом проверенных обращений идут после рейтинга. */
.aa-page .aa-unrated th,.aa-page .aa-unrated td{color:var(--muted)}
.aa-page .aa-unrated-head td{font-size:12px;color:var(--muted);background:var(--soft);text-align:left;padding:6px 10px}
/* «Как пользуются кнопками» (20.10). */
.bu-group summary{cursor:pointer;list-style:none}.bu-group summary::-webkit-details-marker{display:none}
.bu-group summary strong::after{content:' ›';color:var(--muted)}.bu-group[open] summary strong::after{content:' ⌄'}
.bu-items{display:grid;grid-template-columns:repeat(auto-fill,minmax(260px,1fr));gap:6px 16px;margin:10px 0 2px;padding:0;list-style:none}
.bu-items li{display:flex;justify-content:space-between;align-items:baseline;gap:12px;padding:7px 10px;border-radius:8px;background:var(--soft);font-size:13px;line-height:1.4;min-width:0}
.bu-items li>span{min-width:0;overflow-wrap:anywhere}
.bu-items li small{display:block;font-size:12px;color:var(--muted)}
.bu-items li>b{flex:none;font-variant-numeric:tabular-nums;white-space:nowrap}
/* The four tiles keep the card's side padding, as its heading and the list below. */
.bu-kpis{padding:4px 20px 6px}
@media(max-width:600px){.bu-items{grid-template-columns:1fr}}
/* The footer line «Вставка черновика не подтверждает отправку клиенту» (index.html, shown by app.mjs on four pages) is said
   inside the cards on both «Аналитика» tabs (20.10): «Вставлено черновиков» and the page note of «Оценщик». */
main:has(.aa-page)>footer,main:has(#dialog-help)>footer{display:none}
