/* ============ Токены ============ */
:root {
  color-scheme: only light;
  --display: "Iowan Old Style", "Palatino Linotype", Palatino, "Book Antiqua", Georgia, serif;
  --sans: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;

  --page:    #f4f2ec;
  --surface: #fffefc;
  --ink:     #12151c;
  --ink2:    #4f5561;
  --muted:   #7c828d;
  --grid:    #ebe8e0;
  --axis:    #cfcbc0;
  --border:  rgba(18,21,28,.09);
  --hover:   rgba(18,21,28,.045);
  --prev:    #c9c6bb;
  --good:    #0a6b2c;
  --bad:     #c0322f;
  --shadow:  0 1px 2px rgba(18,21,28,.04);
  --shadow-lg: 0 1px 2px rgba(18,21,28,.05);

  --accent: #1f5fae;
  --accent-soft: color-mix(in srgb, var(--accent) 12%, var(--surface));
  --dim: color-mix(in srgb, var(--accent) 36%, var(--surface));
  --s1: var(--accent);
  --hero: linear-gradient(120deg, #0a1f3d 0%, #123a6b 55%, #1d5f9a 100%);
  --hero-line: linear-gradient(90deg, #2fa7c4, #7bd0e6);
  --focus: var(--accent);

  /* у каждого показателя свой цвет везде на странице */
  --c-clicks:   #2a78d6;
  --c-shows:    #eb6834;
  --c-demand:   #1baf7a;
  --c-ctr:      #4a3aa7;
  --c-position: #e87ba4;
  --c-q_top10:  #008300;
}

/* фирменные темы сайтов (работают на любом элементе с data-site) */
[data-site="mrt"] {
  --accent: #1f5fae;
  --hero: linear-gradient(120deg, #0a1f3d 0%, #123a6b 55%, #1d5f9a 100%);
  --hero-line: linear-gradient(90deg, #2fa7c4, #8ee0f2);
  --brand-mid: #3b8fd6;
}
[data-site="raduga"] {
  --accent: #6d3fa3;
  --hero: linear-gradient(120deg, #1d0f3a 0%, #46247c 55%, #7541ab 100%);
  --hero-line: linear-gradient(90deg, #ef4444, #f59e0b, #eab308, #22c55e, #3b82f6, #8b5cf6);
  --brand-mid: #9b6bd6;
}
[data-site="stom"] {
  --accent: #0d7a62;
  --hero: linear-gradient(120deg, #04302a 0%, #0a5646 55%, #12836a 100%);
  --hero-line: linear-gradient(90deg, #b8935a, #ecd6a4, #b8935a);
  --brand-mid: #17a586;
}

/* ============ База ============ */
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; background: var(--page); color: var(--ink);
  font: 15px/1.5 var(--sans); -webkit-font-smoothing: antialiased;
}
h1, h2, h3 { margin: 0; font-weight: 600; }
h2 { font-family: var(--display); font-size: 21px; letter-spacing: -.01em; font-weight: 600; }
h3 { font-size: 13px; color: var(--ink2); font-weight: 600; margin-bottom: 6px; }
a { color: inherit; }
.muted { color: var(--ink2); }
:focus-visible { outline: 2px solid var(--focus); outline-offset: 2px; border-radius: 6px; }

.card {
  background: var(--surface); border: 1px solid var(--border); border-radius: 18px;
  padding: 22px; box-shadow: var(--shadow-lg); min-width: 0;
}

.btn {
  font: inherit; font-size: 14px; color: var(--ink); background: transparent; border: 1px solid var(--border);
  padding: 8px 14px; border-radius: 10px; cursor: pointer; text-decoration: none; display: inline-block;
  transition: background .15s, border-color .15s, transform .05s;
}
.btn:hover { background: var(--hover); }
.btn:active { transform: translateY(1px); }
.btn.primary { background: var(--accent); border-color: var(--accent); color: #fff; font-weight: 600; }
.btn.primary:hover { filter: brightness(1.08); background: var(--accent); }
.btn:disabled { opacity: .45; cursor: not-allowed; }
.btn.icon { padding: 8px 11px; }

.field { display: grid; gap: 6px; font-size: 13px; color: var(--ink2); }
input[type=text], input[type=password], input[type=search], select {
  font: inherit; color: var(--ink); background: var(--surface); border: 1px solid var(--axis);
  border-radius: 10px; padding: 9px 12px; min-width: 0;
}
input:focus, select:focus { border-color: var(--accent); outline: none; box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 22%, transparent); }
.error { color: var(--bad); margin: 0; font-size: 14px; }

/* ============ Вход ============ */
.auth { min-height: 100vh; display: grid; grid-template-columns: 1.15fr 1fr; }
.auth-art {
  position: relative; overflow: hidden; color: #fff; padding: 56px 56px 48px;
  display: flex; flex-direction: column; justify-content: space-between;
  background:
    radial-gradient(circle at 12% 18%, rgba(47,167,196,.42), transparent 42%),
    radial-gradient(circle at 88% 30%, rgba(139,92,246,.40), transparent 44%),
    radial-gradient(circle at 46% 96%, rgba(18,131,106,.50), transparent 46%),
    #0a1220;
}
.auth-art.admin {
  background:
    radial-gradient(circle at 15% 15%, rgba(212,175,110,.30), transparent 40%),
    radial-gradient(circle at 85% 85%, rgba(47,167,196,.30), transparent 45%),
    #0c1119;
}
.auth-art svg.pattern { position: absolute; inset: 0; width: 100%; height: 100%; opacity: .5; pointer-events: none; }
.auth-art > * { position: relative; }
.auth-brand { display: flex; align-items: center; gap: 12px; font-weight: 600; letter-spacing: .01em; }
.auth-headline { font-family: var(--display); font-size: clamp(34px, 4.4vw, 56px); line-height: 1.06; letter-spacing: -.02em; margin: 0 0 16px; font-weight: 600; }
.auth-lead { max-width: 440px; color: rgba(255,255,255,.72); font-size: 16px; margin: 0; }
.auth-sites { display: grid; gap: 10px; margin: 0; padding: 0; list-style: none; }
.auth-sites li { display: flex; align-items: center; gap: 12px; color: rgba(255,255,255,.86); }
.auth-sites i { width: 10px; height: 10px; border-radius: 50%; display: inline-block; box-shadow: 0 0 0 4px rgba(255,255,255,.08); }
.auth-sites small { color: rgba(255,255,255,.5); margin-left: 4px; }
.auth-panel { display: grid; place-items: center; padding: 32px 24px; background: var(--page); }
.auth-form { width: min(400px, 100%); display: grid; gap: 18px; }
.auth-form h1 { font-family: var(--display); font-size: 30px; letter-spacing: -.01em; }
.auth-form p { margin: 0; }
.pw { position: relative; }
.pw input { width: 100%; font-size: 20px; letter-spacing: .12em; padding: 15px 52px 15px 16px; border-radius: 14px; }
.pw input::placeholder { letter-spacing: 0; font-size: 15px; color: var(--muted); }
.pw button {
  position: absolute; right: 8px; top: 50%; transform: translateY(-50%); border: 0; background: none;
  color: var(--muted); cursor: pointer; padding: 8px; border-radius: 8px; font-size: 13px;
}
.pw button:hover { color: var(--ink); background: var(--hover); }
.auth-form .btn.primary { padding: 14px; font-size: 16px; border-radius: 14px; width: 100%; background: linear-gradient(120deg, #123a6b, #1d5f9a); border: 0; }
.auth-form .btn.primary.adm { background: linear-gradient(120deg, #1a2231, #34445f); }
.auth-form .err { animation: shake .4s; }
@keyframes shake { 20%,60% { transform: translateX(-6px); } 40%,80% { transform: translateX(6px); } }
.auth-foot { font-size: 12.5px; color: var(--muted); text-align: center; }
@media (max-width: 860px) {
  .auth { grid-template-columns: 1fr; }
  .auth-art { padding: 28px 24px; gap: 26px; }
  .auth-sites { display: none; }
  .auth-headline { font-size: 32px; margin-bottom: 8px; }
}

/* ============ Шапка сайта (hero) ============ */
.hero { position: relative; color: #fff; background: var(--hero); overflow: hidden; isolation: isolate; }
.hero::after { content: ""; position: absolute; left: 0; right: 0; bottom: 0; height: 3px; background: var(--hero-line); }
.hero-art { position: absolute; inset: 0; z-index: -1; pointer-events: none; }
.hero-art svg { width: 100%; height: 100%; display: block; }
.hero-in { max-width: 1200px; margin: 0 auto; padding: 0 16px 104px; }
.top { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 14px 0; }
.brand { display: flex; align-items: center; gap: 10px; font-weight: 600; letter-spacing: .01em; }
.top-actions { display: flex; gap: 8px; }
.hero .btn { color: #fff; border-color: rgba(255,255,255,.28); background: rgba(255,255,255,.08); backdrop-filter: blur(6px); }
.hero .btn:hover { background: rgba(255,255,255,.18); }
.hero-body { display: flex; flex-wrap: wrap; gap: 20px 28px; align-items: flex-end; justify-content: space-between; padding-top: 30px; }
.eyebrow { font-size: 12.5px; letter-spacing: .14em; text-transform: uppercase; color: rgba(255,255,255,.66); margin-bottom: 8px; }
.hero h1 { font-family: var(--display); font-size: clamp(30px, 4.6vw, 50px); line-height: 1.05; letter-spacing: -.02em; font-weight: 600; }
.hero-sub { margin: 10px 0 0; color: rgba(255,255,255,.74); font-size: 15px; }
.hero-controls { display: grid; gap: 12px; justify-items: end; }
.tabs { display: flex; flex-wrap: wrap; gap: 6px; padding: 5px; border-radius: 999px; background: rgba(255,255,255,.10); border: 1px solid rgba(255,255,255,.16); backdrop-filter: blur(6px); }
.tab {
  font: inherit; font-size: 14px; color: rgba(255,255,255,.82); background: transparent; border: 0;
  border-radius: 999px; padding: 7px 15px; cursor: pointer; display: inline-flex; align-items: center; gap: 8px;
  transition: background .15s;
}
.tab i { width: 8px; height: 8px; border-radius: 50%; background: var(--dot); box-shadow: 0 0 0 2px rgba(255,255,255,.35); }
.tab:hover { background: rgba(255,255,255,.14); }
.tab[aria-selected=true] { background: #fff; color: #10151d; font-weight: 600; }
.tab[aria-selected=true] i { box-shadow: none; }
.tab[data-t=mrt] { --dot: #3b8fd6; } .tab[data-t=raduga] { --dot: #a877e0; } .tab[data-t=stom] { --dot: #17a586; }
.mfield { display: inline-flex; align-items: center; gap: 10px; font-size: 13.5px; color: rgba(255,255,255,.76); }
.mfield select {
  color: #fff; background: rgba(255,255,255,.10); border: 1px solid rgba(255,255,255,.28); border-radius: 999px;
  padding: 8px 16px; font-size: 14px; backdrop-filter: blur(6px);
}
.mfield select option { color: #12151c; background: #fff; }
@media (max-width: 760px) {
  .hero-controls { justify-items: start; width: 100%; }
  .tabs { border-radius: 18px; }
}

.wrap { max-width: 1200px; margin: 0 auto; padding: 0 16px 64px; display: grid; gap: 18px; }
.wrap > *, .grid2 > *, .kpis > * { min-width: 0; }
#content > .wrap { padding: 0; }
main.wrap > #content { display: grid; gap: 18px; }

/* ============ KPI ============ */
.kpis { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 14px; margin-top: -70px; position: relative; z-index: 2; }
.kpi { padding: 18px 18px 16px; display: grid; gap: 4px; align-content: start; position: relative; overflow: hidden; }
.kpi::before { content: ""; position: absolute; left: 0; top: 0; bottom: 0; width: 4px; background: var(--mc, var(--accent)); }
.kpi .label { font-size: 13px; color: var(--ink2); }
.kpi .value { font-size: 32px; font-weight: 650; letter-spacing: -.025em; line-height: 1.15; }
.kpi .deltas { display: grid; gap: 3px; margin-top: 8px; font-size: 13px; }
.delta { display: flex; flex-wrap: wrap; gap: 0 6px; align-items: baseline; }
.delta .lbl { color: var(--muted); }
.delta .val { font-weight: 600; }
.delta.good .val { color: var(--good); }
.delta.bad .val { color: var(--bad); }
.delta.flat .val { color: var(--ink2); }
.empty { padding: 36px; text-align: center; color: var(--ink2); margin-top: -70px; position: relative; z-index: 2; }

/* ============ Графики ============ */
.sec-head { display: flex; flex-wrap: wrap; gap: 10px 16px; align-items: center; justify-content: space-between; margin-bottom: 10px; }
.chips { display: flex; flex-wrap: wrap; gap: 6px; }
.chip {
  font: inherit; font-size: 13px; color: var(--ink2); background: transparent;
  border: 1px solid var(--border); border-radius: 999px; padding: 5px 12px; cursor: pointer;
}
.chip:hover { background: var(--hover); }
.chip { display: inline-flex; align-items: center; gap: 7px; }
.chip[aria-pressed=true] { color: var(--ink); border-color: var(--ink2); background: var(--hover); font-weight: 600; }
.chip[aria-pressed=false] { opacity: .6; }
.chart { width: 100%; position: relative; }
.chart svg { display: block; width: 100%; height: auto; overflow: visible; }
.chart .grid line { stroke: var(--grid); stroke-width: 1; }
.chart .axis line { stroke: var(--axis); stroke-width: 1; }
.chart text { fill: var(--muted); font-size: 12px; font-family: var(--sans); }
.chart .bar { fill: color-mix(in srgb, var(--mc, var(--accent)) 38%, var(--surface)); }
.chart .bar.sel, .chart .bar.cur { fill: var(--mc, var(--accent)); }
.chart .bar.prev { fill: var(--prev); }
.chart .line { fill: none; stroke: var(--mc, var(--accent)); stroke-width: 2.25; stroke-linejoin: round; stroke-linecap: round; }
.chart .dot { fill: var(--mc, var(--accent)); stroke: var(--surface); stroke-width: 2; }
.chart .hit { fill: transparent; }
.legend { display: flex; flex-wrap: wrap; gap: 14px; font-size: 13px; color: var(--ink2); margin-top: 6px; }
.legend i { display: inline-block; width: 10px; height: 10px; border-radius: 3px; margin-right: 6px; vertical-align: -1px; }
.note { font-size: 12.5px; color: var(--muted); margin: 6px 0 0; }
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; }
@media (max-width: 860px) { .grid2 { grid-template-columns: 1fr; } .kpis { margin-top: -56px; } }

/* ============ Таблицы ============ */
.tbl-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; font-size: 14px; }
th, td { text-align: right; padding: 10px 10px; border-bottom: 1px solid var(--grid); white-space: nowrap; }
th:first-child, td:first-child { text-align: left; }
th { font-weight: 600; color: var(--ink2); font-size: 12.5px; letter-spacing: .02em; background: var(--surface); }
th button { font: inherit; color: inherit; font-weight: inherit; background: none; border: 0; cursor: pointer; padding: 0; }
th button[data-dir]::after { content: attr(data-dir); margin-left: 4px; color: var(--accent); }
tbody tr.row { cursor: pointer; transition: background .12s; }
tbody tr.row:hover { background: var(--hover); }
td.q { max-width: 380px; overflow: hidden; text-overflow: ellipsis; text-align: left; white-space: normal; word-break: break-word; }
tr.detail td { background: var(--page); white-space: normal; padding: 16px; }
.hist { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; }
@media (max-width: 700px) { .hist { grid-template-columns: 1fr; } }
.toolbar { display: flex; gap: 12px; align-items: center; flex-wrap: wrap; margin-bottom: 12px; }
.toolbar input { flex: 1 1 240px; }
td .delta { display: inline-flex; min-width: 54px; justify-content: flex-end; flex-wrap: nowrap; white-space: nowrap; font-size: 12px; margin-left: 4px; }
.spark { width: 110px; height: 28px; }
.spark .line { fill: none; stroke: var(--bm, var(--accent)); stroke-width: 1.9; stroke-linejoin: round; stroke-linecap: round; }
.spark .dot { fill: var(--bm, var(--accent)); stroke: var(--surface); stroke-width: 2; }
.sitename { display: inline-flex; align-items: center; gap: 8px; }
.sitename i { width: 9px; height: 9px; border-radius: 50%; background: var(--bm); display: inline-block; }

.movers ul { list-style: none; margin: 0; padding: 0; }
.movers li { display: flex; justify-content: space-between; gap: 12px; padding: 8px 0; border-bottom: 1px solid var(--grid); }
.movers .name { overflow: hidden; word-break: break-word; }
.movers .v { white-space: nowrap; font-weight: 600; }
.movers .v.good { color: var(--good); } .movers .v.bad { color: var(--bad); }
details.card summary { cursor: pointer; font-weight: 600; font-family: var(--display); font-size: 18px; }

/* ============ Подсказка ============ */
.tip {
  position: fixed; z-index: 30; pointer-events: none; background: var(--surface); color: var(--ink);
  border: 1px solid var(--axis); border-radius: 12px; padding: 10px 12px; font-size: 13px;
  box-shadow: 0 10px 30px rgba(0,0,0,.2); max-width: 270px;
}
.tip b { display: block; margin-bottom: 3px; }
.tip .r { display: flex; justify-content: space-between; gap: 16px; color: var(--ink2); }
.tip .r span:last-child { color: var(--ink); font-weight: 600; }

/* ============ Админка ============ */
.admin-hero { background: linear-gradient(120deg, #0c1119 0%, #1a2436 60%, #2a3a55 100%); color: #fff; }
.admin-hero::after { background: linear-gradient(90deg, #b8935a, #ecd6a4, #b8935a); }
.admin-hero .hero-in { padding-bottom: 88px; }
.site-cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(330px, 1fr)); gap: 18px; margin-top: -60px; position: relative; z-index: 2; }
.sitecard { padding: 0; overflow: hidden; display: flex; flex-direction: column; }
.sc-head { background: var(--hero); color: #fff; padding: 18px 20px; position: relative; }
.sc-head::after { content: ""; position: absolute; left: 0; right: 0; bottom: 0; height: 3px; background: var(--hero-line); }
.sc-head h2 { color: #fff; font-size: 22px; }
.sc-head p { margin: 2px 0 0; color: rgba(255,255,255,.72); font-size: 13.5px; }
.sc-body { padding: 18px 20px 20px; display: grid; gap: 14px; }
.stats { display: flex; gap: 22px; flex-wrap: wrap; }
.stat b { display: block; font-size: 20px; letter-spacing: -.01em; }
.stat span { font-size: 12.5px; color: var(--muted); }
.drop {
  border: 2px dashed var(--axis); border-radius: 14px; padding: 22px 14px; text-align: center; cursor: pointer;
  color: var(--ink2); font-size: 14px; transition: border-color .15s, background .15s;
}
.drop.over, .drop:hover { border-color: var(--accent); background: var(--accent-soft); }
.drop.has { border-style: solid; border-color: var(--accent); color: var(--ink); background: var(--accent-soft); }
.drop small { display: block; color: var(--muted); margin-top: 4px; }
.sc-body .btn.primary { width: 100%; padding: 11px; }
.ok-box, .err-box, .warn-box { border-radius: 12px; padding: 12px 14px; border: 1px solid var(--border); font-size: 14px; }
.ok-box { border-left: 4px solid var(--good); }
.err-box { border-left: 4px solid var(--bad); }
.warn-box { border-left: 4px solid #d99a1c; }
.ok-box ul, .err-box ul { margin: 6px 0 0; padding-left: 18px; }
.months { display: flex; flex-wrap: wrap; gap: 6px; }
.m { border: 1px solid var(--border); border-radius: 8px; padding: 3px 8px; font-size: 12.5px; display: inline-flex; gap: 6px; align-items: center; color: var(--ink2); }
.m button { border: 0; background: none; color: var(--muted); cursor: pointer; font-size: 15px; padding: 0 2px; line-height: 1; }
.m button:hover { color: var(--bad); }
.sc-body details summary { cursor: pointer; font-size: 13.5px; color: var(--ink2); }
.admin-sec { padding: 22px; }
.admin-sec h2 { margin-bottom: 12px; }
.admin-main { max-width: 1200px; margin: 0 auto; padding: 0 16px 64px; display: grid; gap: 18px; }
.admin-main table th, .admin-main table td { text-align: left; }

/* ============ Справка, подсказки, цвета показателей ============ */
.sw { display: inline-block; width: 10px; height: 10px; border-radius: 3px; margin-right: 7px; flex: none; vertical-align: -1px; }
.chip .sw, th .sw, .tip .sw { margin-right: 6px; }
.stack { display: grid; gap: 18px; }
.stack > * { min-width: 0; }
.kpi .label { display: flex; align-items: center; }
.kdesc { font-size: 12.5px; color: var(--muted); line-height: 1.4; min-height: 2.8em; }
.hint { margin: -2px 0 12px; color: var(--ink2); font-size: 14px; max-width: 78ch; }
.legend.big { font-size: 14px; gap: 10px 18px; margin-top: 4px; }
.legend.big .sw { width: 12px; height: 12px; }
.gtext { color: var(--good); } .btext { color: var(--bad); }

details.guide { padding: 16px 22px; background: linear-gradient(0deg, var(--surface), var(--surface)), var(--accent-soft); border-left: 4px solid var(--accent); }
details.guide summary { display: flex; align-items: center; gap: 10px; font-family: var(--display); font-size: 18px; font-weight: 600; cursor: pointer; }
.qmark { display: inline-grid; place-items: center; width: 24px; height: 24px; border-radius: 50%; background: var(--accent); color: #fff; font: 700 14px var(--sans); }
.guide-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 22px; margin-top: 14px; }
.guide-grid p { margin: 0; font-size: 14px; color: var(--ink2); }
@media (max-width: 860px) { .guide-grid { grid-template-columns: 1fr; gap: 14px; } }

.help-fab {
  position: fixed; right: 18px; bottom: 18px; z-index: 40; display: inline-flex; align-items: center; gap: 8px;
  border: 0; border-radius: 999px; padding: 10px 16px 10px 10px; cursor: pointer; color: #fff; font: 600 14px var(--sans);
  background: var(--accent); box-shadow: 0 8px 24px -6px rgba(0,0,0,.45);
}
.help-fab span { display: grid; place-items: center; width: 26px; height: 26px; border-radius: 50%; background: rgba(255,255,255,.25); font-weight: 700; }
.help-fab em { font-style: normal; }
.help-fab:hover { filter: brightness(1.08); }
.help {
  position: fixed; top: 0; right: 0; bottom: 0; z-index: 50; width: min(420px, 100vw); overflow-y: auto;
  background: var(--surface); border-left: 1px solid var(--axis); box-shadow: -18px 0 40px -20px rgba(0,0,0,.4); padding: 18px 22px 30px;
}
.help[hidden] { display: none; }
.help-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 8px; position: sticky; top: -18px; background: var(--surface); padding: 12px 0; }
.help h3 { margin: 18px 0 8px; font-size: 12.5px; text-transform: uppercase; letter-spacing: .08em; }
.help p { margin: 6px 0; font-size: 14px; color: var(--ink2); }
.help-item { display: flex; gap: 12px; align-items: flex-start; padding: 8px 0; border-bottom: 1px solid var(--grid); }
.help-item .sw { width: 14px; height: 14px; margin-top: 4px; }
.help-item p { margin: 2px 0 0; }
@media (max-width: 560px) { .help-fab em { display: none; } .help-fab { padding: 10px; } }

/* ============ Админка: шаги ============ */
.admin-main > .steps { margin-top: -60px; position: relative; z-index: 2; display: grid; gap: 14px; }
.steps h2 { display: flex; align-items: center; gap: 12px; margin-top: 8px; }
.steps h2:first-child { margin-top: 0; }
.step { display: inline-grid; place-items: center; width: 30px; height: 30px; border-radius: 50%; background: var(--ink); color: var(--surface); font: 700 15px var(--sans); }
.site-cards.pick { margin-top: 0; }
.sitecard.pick { text-align: left; cursor: pointer; font: inherit; color: inherit; padding: 0; transition: transform .12s, box-shadow .12s; }
.sitecard.pick:hover { transform: translateY(-2px); }
.sitecard.pick.selected { outline: 3px solid var(--accent); outline-offset: 2px; }
.pick-mark { font-size: 13.5px; font-weight: 600; color: var(--ink2); }
.selected .pick-mark { color: var(--accent); }
.send-row { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; }
.send-row .btn.primary { padding: 12px 24px; font-size: 16px; border-radius: 12px; }
.howto { margin: 0 0 8px; padding-left: 22px; display: grid; gap: 8px; }
.covsite { margin-bottom: 14px; }
.drop small { display: block; color: var(--muted); margin-top: 4px; }
#result:empty, #detected:empty { display: none; }

/* ============ Автосводка ============ */
.sum { border-left: 4px solid var(--border); }
.sum[data-tone="good"] { border-left-color: var(--good); }
.sum[data-tone="bad"] { border-left-color: var(--bad); }
.sum-head { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.sum-head h2 { margin: 0; }
.badge {
  font-size: 11px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase;
  padding: 3px 10px; border-radius: 99px; background: var(--accent-soft); color: var(--accent);
}
.sum-lead { font-family: var(--display); font-size: clamp(19px, 2.3vw, 25px); line-height: 1.35; margin: 12px 0 6px; color: var(--ink); }
.sum-lead.sm { font-size: clamp(17px, 2vw, 20px); margin-top: 4px; }
.sum-sub { margin: 4px 0 0; color: var(--ink2); font-size: 15px; line-height: 1.5; }
.notice {
  margin: 12px 0 0; padding: 10px 14px; border-radius: 10px; font-size: 13.5px; line-height: 1.5; color: var(--ink);
  background: color-mix(in srgb, #d99a1c 11%, var(--surface)); border: 1px solid color-mix(in srgb, #d99a1c 32%, transparent);
}
.sum-points { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 320px), 1fr)); gap: 0 32px; margin-top: 16px; }
.pt { display: grid; grid-template-columns: 24px minmax(0, 1fr); gap: 12px; padding: 12px 0; border-top: 1px solid var(--grid); }
.pt .ic {
  width: 22px; height: 22px; border-radius: 50%; display: grid; place-items: center;
  font-size: 10px; font-weight: 700; color: #fff; background: var(--muted); margin-top: 1px; font-style: normal;
}
.pt.good .ic { background: var(--good); }
.pt.bad .ic { background: var(--bad); }
.pt.info .ic { background: var(--accent); font-family: var(--display); font-size: 12px; font-style: italic; }
.pt h3 { margin: 0 0 3px; font: 600 13.5px var(--sans); color: var(--ink); }
.pt p { margin: 0; font-size: 14px; line-height: 1.55; color: var(--ink2); overflow-wrap: anywhere; }
.sub-h { display: flex; align-items: center; gap: 8px; margin: 18px 0 4px; font: 600 14px var(--sans); }
.qtable td .delta { min-width: 0; margin-left: 0; font-size: 13px; }
.sec-head select { max-width: 100%; }

.chron { display: grid; gap: 2px; margin-top: 10px; }
.chron-row {
  display: grid; grid-template-columns: 160px 190px minmax(0, 1fr) auto; gap: 6px 16px; align-items: baseline; text-align: left;
  width: 100%; font: inherit; color: inherit; background: none; border: 0; border-top: 1px solid var(--grid);
  padding: 10px 8px; cursor: pointer; border-radius: 8px;
}
.chron-row:hover { background: var(--hover); }
.chron-row.cur { background: var(--accent-soft); }
.chron-row .cm { font-weight: 600; }
.chron-row .tag { font-size: 13px; font-weight: 600; color: var(--ink2); }
.chron-row .tag.good { color: var(--good); }
.chron-row .tag.bad { color: var(--bad); }
.chron-row .t { color: var(--ink2); font-size: 13.5px; overflow-wrap: anywhere; }
.chron-row .v { font-variant-numeric: tabular-nums; font-size: 13.5px; color: var(--muted); white-space: nowrap; }
@media (max-width: 760px) {
  .chron-row { grid-template-columns: 1fr auto; }
  .chron-row .t { grid-column: 1 / -1; }
  .chron-row .tag { justify-self: end; }
}

.qtable th:first-child, .qtable td:first-child { position: sticky; left: 0; background: var(--surface); z-index: 1; }
.scroll-hint { display: none; }
@media (max-width: 640px) {
  .qtable th, .qtable td { padding: 9px 8px; font-size: 13px; }
  .qtable td:first-child { max-width: 122px; white-space: normal; }
  .scroll-hint { display: block; }
  .chron-row { grid-template-columns: auto minmax(0, 1fr); }
  .chron-row .cm { white-space: nowrap; }
  .chron-row .tag { text-align: right; }
  .chron-row .v { grid-column: 1 / -1; }
}

/* мягкий тон в выводах: откаты — янтарные, не красные */
:root { --warn: #b7791f; }
.sum[data-tone="warn"] { border-left-color: var(--warn); }
.pt.warn .ic { background: var(--warn); }
.chron-row .tag.warn { color: var(--warn); }
.mood { font-size: 12.5px; font-weight: 700; padding: 3px 11px; border-radius: 99px; background: var(--hover); color: var(--ink2); }
.mood.good { background: color-mix(in srgb, var(--good) 12%, var(--surface)); color: var(--good); }
.mood.warn { background: color-mix(in srgb, var(--warn) 14%, var(--surface)); color: var(--warn); }
.mood-row { margin: 4px 0 0; }
.sum-win { margin: 6px 0 2px; font-size: 15.5px; font-weight: 600; color: var(--good); line-height: 1.45; }
.sum-groups { display: grid; gap: 6px; margin-top: 10px; }
.grp-h { margin: 14px 0 0; font: 700 12px var(--sans); letter-spacing: .09em; text-transform: uppercase; color: var(--muted); }
.grp-hint { margin: 2px 0 0; font-size: 13px; color: var(--muted); }
.grp .sum-points { margin-top: 4px; }
.grp.wins .grp-h { color: var(--good); }
.grp.watch .grp-h { color: var(--warn); }
