/* MAKEDEN analytics: quiet and exact. Small type, thin lines, one green, lime only as a small signal. */
:root {
  --bg: #F5F6F4;
  --card: #FFFFFF;
  --head: #FAFBFA;
  --ink: #0F1A17;
  --on-ink: #FFFFFF;
  --muted: #66726E;
  --faint: #9AA49F;
  --line: #E5E9E6;
  --line2: #F0F2F0;
  --brand: #0B6B5D;
  --brand-soft: #E3F0EC;
  --lime: #C6F36D;
  --on-lime: #0B1F1C;
  --good: #15803D;
  --bad: #DC2626;
  --bad-soft: #FDECEC;
  --warn: #B7791F;
  --warn-soft: #FDF5E3;
  --shadow: 0 1px 2px rgba(15, 26, 23, .04);
  --r: 12px;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0C1412;
    --card: #121C19;
    --head: #15201D;
    --ink: #E6EDEA;
    --on-ink: #0C1412;
    --muted: #9AAAA5;
    --faint: #6C7D78;
    --line: #22302C;
    --line2: #1A2623;
    --brand: #3DB39C;
    --brand-soft: #16302A;
    --good: #4ADE80;
    --bad: #F87171;
    --bad-soft: #3A1D1F;
    --warn-soft: #3A2E14;
    --shadow: none;
    color-scheme: dark;
  }
}

* { box-sizing: border-box; }
html, body { margin: 0; }
body {
  background: var(--bg);
  color: var(--ink);
  font: 13px/1.45 Onest, system-ui, -apple-system, "Segoe UI", sans-serif;
  -webkit-font-smoothing: antialiased;
}
a { color: inherit; text-decoration: none; }
button { font: inherit; color: inherit; cursor: pointer; }
input { font: inherit; color: inherit; }
b { font-weight: 600; }
.muted { color: var(--muted); }
.boot { padding: 40vh 16px; text-align: center; color: var(--muted); }

/* ── top bar ─────────────────────────────────────────── */
.top {
  position: sticky; top: 0; z-index: 20;
  display: flex; align-items: center; justify-content: space-between; gap: 10px; flex-wrap: wrap;
  min-height: 52px; padding: 8px max(16px, env(safe-area-inset-left)) 8px max(16px, env(safe-area-inset-right));
  background: color-mix(in srgb, var(--card) 92%, transparent);
  backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--line);
}
.top-l, .top-r { display: flex; align-items: center; gap: 8px; min-width: 0; }
.logo b { font-size: 15px; font-weight: 700; letter-spacing: -.02em; }
.logo b::after { content: ""; display: inline-block; width: 5px; height: 5px; border-radius: 50%; background: var(--lime); margin-left: 2px; box-shadow: 0 0 0 1px rgba(15, 26, 23, .25); }
.crumb { color: var(--faint); }
.back, .here { color: var(--muted); white-space: nowrap; }
.back:hover { color: var(--ink); }
.per { position: relative; }
.per-btn, .seg, .icon-btn { height: 32px; border: 1px solid var(--line); background: var(--card); border-radius: 8px; }
.per-btn { padding: 0 10px; white-space: nowrap; display: inline-flex; align-items: center; gap: 7px; }
.per-btn .chev { color: var(--faint); font-size: 10px; }
.per-l { overflow: hidden; text-overflow: ellipsis; min-width: 0; }
.cal-ic { flex: none; color: var(--muted); }
.seg { display: inline-flex; padding: 2px; gap: 2px; }
.seg button { border: 0; background: transparent; border-radius: 6px; min-width: 28px; padding: 0 10px; color: var(--muted); }
.seg button.on { background: var(--ink); color: var(--on-ink); }
.icon-btn { width: 32px; display: grid; place-items: center; font-size: 15px; color: var(--muted); }
.icon-btn:hover, .per-btn:hover { border-color: color-mix(in srgb, var(--ink) 25%, var(--line)); }
.icon-btn.spin { animation: spin 1s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.ld-btn { position: relative; overflow: hidden; width: auto; min-width: 56px; padding: 0 10px; color: var(--ink); font-size: 12.5px; }
.ld-btn i { position: absolute; inset: 0 auto 0 0; background: color-mix(in srgb, var(--brand) 20%, transparent); transition: width .1s linear; }
.ld-btn > span { position: relative; white-space: nowrap; }
.ld-btn b { font-weight: 600; font-variant-numeric: tabular-nums; }
body.stale main { opacity: .45; transition: opacity .15s; }

.btn { height: 32px; padding: 0 14px; border-radius: 8px; border: 0; background: var(--ink); color: var(--on-ink); font-weight: 500; white-space: nowrap; }
.btn.ghost { background: var(--card); color: var(--ink); border: 1px solid var(--line); }
.btn.wide { width: 100%; height: 40px; }

/* ── calendar ────────────────────────────────────────── */
.per-menu {
  position: absolute; right: 0; top: 40px; z-index: 30;
  background: var(--card); border: 1px solid var(--line); border-radius: var(--r);
  box-shadow: 0 12px 32px rgba(15, 26, 23, .12);
}
.per-menu.cal { width: min(500px, calc(100vw - 32px)); display: grid; grid-template-columns: 136px minmax(0, 1fr); gap: 14px; padding: 12px; }
.cal-presets { display: grid; gap: 2px; align-content: start; }
.cal-presets button { text-align: left; border: 0; background: transparent; border-radius: 7px; padding: 7px 10px; color: var(--muted); }
.cal-presets button:hover { background: var(--line2); color: var(--ink); }
.cal-presets button.on { background: var(--brand-soft); color: var(--brand); font-weight: 600; }
.cal-main { display: grid; gap: 8px; align-content: start; }
.cal-head { display: flex; align-items: center; justify-content: space-between; }
.cal-head button { width: 28px; height: 28px; border-radius: 7px; border: 1px solid var(--line); background: var(--card); font-size: 16px; line-height: 1; }
.cal-head button:disabled { opacity: .35; cursor: default; }
.cal-grid { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 2px 0; }
.cal-grid .wd { text-align: center; font-size: 11px; color: var(--faint); padding: 2px 0 4px; }
.cal-grid button { height: 32px; border: 0; background: transparent; font-variant-numeric: tabular-nums; }
.cal-grid button:hover { background: var(--line2); border-radius: 7px; }
.cal-grid button.in { background: var(--brand-soft); }
.cal-grid button.edge { background: var(--brand); color: #fff; border-radius: 7px; font-weight: 600; }
.cal-grid button.now:not(.edge) { font-weight: 700; color: var(--brand); }
.cal-grid button.out { color: var(--faint); opacity: .45; cursor: default; }
.cal-grid button.out:hover { background: transparent; }
.cal-foot { display: flex; justify-content: space-between; gap: 8px; flex-wrap: wrap; font-size: 12px; padding-top: 8px; border-top: 1px solid var(--line2); }
.cal-foot span { color: var(--faint); }

/* ── page ────────────────────────────────────────────── */
.wrap { max-width: 1360px; margin: 0 auto; padding: 18px 16px 48px; }
.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--r); box-shadow: var(--shadow); }
.banner { margin: 0 0 12px; padding: 9px 14px; border-radius: 10px; background: var(--warn-soft); border: 1px solid color-mix(in srgb, var(--warn) 25%, transparent); }
.banner.err { background: var(--bad-soft); border-color: color-mix(in srgb, var(--bad) 25%, transparent); }
.empty { padding: 26px; text-align: center; color: var(--muted); border: 1px dashed var(--line); border-radius: var(--r); background: var(--card); }
.empty.sm { border: 0; padding: 40px 16px; }
/* loading: a bar and a percentage that keep moving while the ad accounts answer */
.ld { display: grid; justify-items: center; gap: 8px; padding: 34px 16px; }
.ld-bar { width: min(320px, 100%); height: 6px; border-radius: 99px; background: var(--line2); overflow: hidden; }
.ld-bar i { display: block; height: 100%; background: var(--brand); border-radius: 99px; transition: width .1s linear; }
.ld b { font-size: 22px; color: var(--ink); font-variant-numeric: tabular-nums; letter-spacing: -.01em; }
.foot { color: var(--faint); font-size: 12px; margin: 14px 2px 0; }
.ph { margin: 2px 2px 14px; }
.ph h1 { margin: 0; font-size: 20px; font-weight: 650; letter-spacing: -.015em; line-height: 1.25; }
.ph p { margin: 3px 0 0; color: var(--muted); }
.date-btn { border: 0; background: none; padding: 0; color: inherit; display: inline-flex; align-items: center; gap: 4px; border-bottom: 1px dashed var(--faint); line-height: 1.3; }
.date-btn:hover { color: var(--ink); border-bottom-color: var(--ink); }
.date-btn .cal-ic { width: 13px; height: 13px; }

/* summary strip */
.kpis { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); margin-bottom: 12px; }
.kpi { padding: 12px 16px; display: grid; gap: 4px; align-content: start; border-left: 1px solid var(--line2); min-width: 0; }
.kpi:first-child { border-left: 0; }
.kpi span { color: var(--muted); font-size: 12px; display: flex; align-items: center; gap: 5px; white-space: nowrap; }
.kpi b { font-size: 20px; font-weight: 600; letter-spacing: -.02em; font-variant-numeric: tabular-nums; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.kpi b.pos { color: var(--brand); }
.kpi.na b { color: var(--faint); font-weight: 500; }
.kpi small { color: var(--faint); font-size: 11px; }

/* Доход / Расход + ROAS */
.g-money { display: grid; grid-template-columns: minmax(0, 3fr) minmax(0, 1fr); gap: 12px; margin-bottom: 12px; }
.mrow { display: flex; justify-content: space-between; gap: 12px; padding: 6px 16px 10px; }
.mrow > div { display: grid; gap: 2px; min-width: 0; }
.mrow .r { text-align: right; }
.mrow span { color: var(--muted); font-size: 12px; }
.mrow b { font-size: 24px; font-weight: 650; letter-spacing: -.02em; font-variant-numeric: tabular-nums; white-space: nowrap; }
.mrow b.rv { color: var(--good); }
.mrow b.sp { color: var(--bad); }
.mbar { display: flex; height: 10px; margin: 0 16px; border-radius: 5px; overflow: hidden; background: var(--line2); gap: 2px; }
.mbar i { display: block; height: 100%; }
.mbar .rv { background: var(--good); border-radius: 5px 0 0 5px; }
.mbar .sp { background: var(--bad); border-radius: 0 5px 5px 0; opacity: .85; }
.mcard .cnote { margin-top: 10px; }
.gcard { display: grid; justify-items: center; align-content: start; padding-bottom: 12px; }
.gcard .ch { justify-self: stretch; }
.dial { width: 150px; margin-top: 4px; }
.dial .needle { stroke: var(--ink); stroke-width: 3; stroke-linecap: round; }
.dial .hub { fill: var(--ink); }
.gv { font-size: 22px; font-weight: 650; letter-spacing: -.02em; font-variant-numeric: tabular-nums; margin-top: 2px; }
.gs { color: var(--faint); font-size: 12px; display: flex; align-items: center; gap: 5px; }

.g2 { display: grid; grid-template-columns: minmax(0, 5fr) minmax(0, 7fr); gap: 12px; margin-bottom: 12px; }
.ch { display: flex; align-items: center; gap: 6px; padding: 12px 16px 4px; }
.ch b { font-size: 13px; }
.ch > span:not(.lg) { color: var(--faint); font-size: 12px; margin-left: 2px; }
.cnote { margin: 4px 16px 14px; font-size: 12px; color: var(--faint); }

/* funnel as rows */
.frows { display: grid; gap: 2px; padding: 6px 16px 10px; }
.fr { display: grid; grid-template-columns: 122px minmax(0, 1fr) 74px 46px; align-items: center; gap: 10px; height: 30px; }
.fl { color: var(--muted); display: flex; align-items: center; gap: 5px; white-space: nowrap; }
.fbar { height: 8px; border-radius: 4px; background: var(--line2); overflow: hidden; }
.fbar i { display: block; height: 100%; border-radius: 4px; background: var(--brand); }
.fr b { text-align: right; font-variant-numeric: tabular-nums; }
.fr em { font-style: normal; text-align: right; color: var(--muted); font-size: 12px; font-variant-numeric: tabular-nums; cursor: help; }
.fr.off .fbar { background: repeating-linear-gradient(135deg, var(--line2) 0 4px, transparent 4px 8px); }
.fr.off b { color: var(--faint); font-weight: 500; }

/* chart */
.ch .lg { margin-left: auto; display: inline-flex; align-items: center; gap: 6px; color: var(--muted); font-size: 12px; }
.lg i { display: inline-block; width: 10px; height: 10px; border-radius: 2px; }
.lg .lb { background: var(--brand); opacity: .8; }
.lg .ll { height: 2px; border-radius: 1px; background: var(--ink); margin-left: 8px; }
.chart { display: block; width: 100%; height: auto; padding: 0 8px 6px; }
.chart .gl { stroke: var(--line2); stroke-width: 1; }
.chart .ax { fill: var(--faint); font-size: 10px; font-family: inherit; }
.chart .ax.l { text-anchor: end; }
.chart .ax.r { text-anchor: start; }
.chart .ax.c { text-anchor: middle; }
.chart .bar { fill: var(--brand); opacity: .8; }
.chart .ln { fill: none; stroke: var(--ink); stroke-width: 1.6; stroke-linejoin: round; }
.chart .pt { fill: var(--card); stroke: var(--ink); stroke-width: 1.4; }
.chart .hz { fill: transparent; cursor: crosshair; }
.chart .hz:hover { fill: color-mix(in srgb, var(--ink) 5%, transparent); }

/* more numbers */
.more { display: grid; grid-template-columns: repeat(8, minmax(0, 1fr)); margin-bottom: 4px; }
.mi { padding: 10px 14px; display: grid; gap: 2px; border-left: 1px solid var(--line2); min-width: 0; }
.mi:first-child { border-left: 0; }
.mi span { color: var(--muted); font-size: 12px; display: flex; align-items: center; gap: 5px; white-space: nowrap; }
.mi b { font-size: 14px; font-variant-numeric: tabular-nums; white-space: nowrap; }
.mi.na b { color: var(--faint); font-weight: 500; }

.q {
  position: relative; display: inline-grid; place-items: center; width: 13px; height: 13px; flex: none;
  border-radius: 50%; border: 1px solid var(--line); font-size: 9px; font-style: normal; font-weight: 600; color: var(--faint); cursor: help;
}
.q::after { content: ""; position: absolute; inset: -8px; } /* a bigger target for a finger */
.q:hover { color: var(--ink); border-color: var(--ink); }
.tip {
  position: fixed; left: 0; top: 0; z-index: 60; max-width: 260px; padding: 7px 11px; border-radius: 8px;
  background: var(--ink); color: var(--on-ink); font-size: 12px; line-height: 1.4;
  box-shadow: 0 8px 24px rgba(0, 0, 0, .18); pointer-events: none;
  opacity: 0; transform: translateY(3px); transition: opacity .1s, transform .1s; visibility: hidden;
}
.tip.on { opacity: 1; transform: none; visibility: visible; }

/* ── tabs + toolbar ──────────────────────────────────── */
.tabs { display: flex; gap: 22px; margin: 22px 0 12px; border-bottom: 1px solid var(--line); overflow-x: auto; scrollbar-width: none; }
.tabs::-webkit-scrollbar { display: none; }
.tabs a { padding: 9px 0 10px; white-space: nowrap; color: var(--muted); font-weight: 500; border-bottom: 2px solid transparent; margin-bottom: -1px; }
.tabs a:hover { color: var(--ink); }
.tabs a.on { color: var(--ink); border-bottom-color: var(--ink); }
.tabs a sup { font-size: 10px; color: var(--faint); margin-left: 3px; }
.tbar { display: flex; gap: 8px; align-items: center; margin: 0 0 12px; flex-wrap: wrap; }
.tbar .grow { flex: 1; }
.search { height: 32px; border: 1px solid var(--line); background: var(--card); border-radius: 8px; padding: 0 12px; min-width: 0; flex: 0 1 240px; }
.search:focus, .per-btn:focus-visible { outline: 2px solid color-mix(in srgb, var(--brand) 40%, transparent); outline-offset: 1px; }
.chips { display: flex; gap: 6px; flex-wrap: wrap; }
.chips button { height: 30px; border: 1px solid var(--line); background: var(--card); border-radius: 999px; padding: 0 12px; white-space: nowrap; color: var(--muted); font-size: 12.5px; }
.chips button:hover { color: var(--ink); }
.chips button.on { background: var(--ink); color: var(--on-ink); border-color: var(--ink); }

/* ── platforms ───────────────────────────────────────── */
.plat { display: inline-block; font-size: 10.5px; font-weight: 600; padding: 0 6px; border-radius: 5px; margin-right: 6px; line-height: 17px; vertical-align: 1px; }
.plat.meta { background: #E7F0FE; color: #1D4ED8; }
.plat.tiktok { background: #111; color: #fff; }
.plat.google { background: #FDF0DC; color: #B45309; }
@media (prefers-color-scheme: dark) { .plat.meta { background: #1E2A44; color: #93B4F8; } .plat.tiktok { background: #E6EDEA; color: #0C1412; } .plat.google { background: #3A2E14; color: #F5C46B; } }
.plats { margin: 0 0 12px; }
.plats sup { font-size: 10px; opacity: .7; }

/* ── creatives ───────────────────────────────────────── */
.crs { display: grid; grid-template-columns: repeat(auto-fill, minmax(176px, 1fr)); gap: 12px; }
.cr { background: var(--card); border: 1px solid var(--line); border-radius: var(--r); overflow: hidden; display: flex; flex-direction: column; transition: border-color .15s, box-shadow .15s; }
.cr:hover { border-color: color-mix(in srgb, var(--ink) 20%, var(--line)); box-shadow: 0 6px 18px rgba(15, 26, 23, .06); }
.cr.dim { opacity: .55; }
.cr-pic { position: relative; aspect-ratio: 1 / 1; background: var(--line2); }
.cr-pic[data-img] { cursor: zoom-in; }
.cr-pic img { width: 100%; height: 100%; object-fit: cover; display: block; }
.cr-pic .nopic { position: absolute; inset: 0; display: grid; place-items: center; color: var(--faint); font-size: 12px; }
/* a Google text ad in place of a picture */
.cr-text { position: absolute; inset: 0; padding: 38px 14px 14px; display: flex; flex-direction: column; gap: 8px; overflow: hidden;
  background: linear-gradient(180deg, var(--card), var(--line2)); }
.cr-text b { font-size: 13px; line-height: 1.35; color: #1A56DB; font-weight: 600; display: -webkit-box; -webkit-line-clamp: 4; -webkit-box-orient: vertical; overflow: hidden; }
.cr-text span { font-size: 12px; line-height: 1.4; color: var(--muted); display: -webkit-box; -webkit-line-clamp: 4; -webkit-box-orient: vertical; overflow: hidden; }
@media (prefers-color-scheme: dark) { .cr-text b { color: #8AB4F8; } }
/* a TikTok video without a cover */
.cr-tt { position: absolute; inset: 0; padding: 38px 14px 14px; display: flex; flex-direction: column; justify-content: flex-end; gap: 10px;
  background: radial-gradient(120% 90% at 20% 0%, #2a2a2a, #0d0d0d); color: #fff; }
.cr-tt i { position: absolute; left: 50%; top: 42%; width: 44px; height: 44px; margin: -22px 0 0 -22px; border-radius: 50%; background: rgba(255, 255, 255, .14); }
.cr-tt i::after { content: ""; position: absolute; left: 17px; top: 13px; border-left: 14px solid #fff; border-top: 9px solid transparent; border-bottom: 9px solid transparent; }
.cr-tt b { font-size: 12px; font-weight: 500; line-height: 1.35; display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
.cr-rank {
  position: absolute; top: 8px; left: 8px; min-width: 22px; height: 22px; padding: 0 6px; border-radius: 6px;
  display: grid; place-items: center; font-weight: 600; font-size: 11px; color: #fff; background: rgba(15, 26, 23, .7);
}
.cr-badge { position: absolute; left: 8px; bottom: 8px; padding: 3px 8px; border-radius: 6px; background: var(--lime); color: var(--on-lime); font-size: 11px; font-weight: 600; }
.cr-body { padding: 10px 12px 12px; display: grid; gap: 8px; }
.cr-name { display: flex; align-items: flex-start; gap: 6px; min-width: 0; }
.cr-name .dot { margin-top: 5px; }
.cr-name b { font-weight: 500; font-size: 12.5px; line-height: 1.35; min-height: 2.7em; overflow: hidden; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
.cr-big { display: flex; align-items: baseline; gap: 5px; }
.cr-big b { font-size: 18px; font-weight: 650; letter-spacing: -.02em; font-variant-numeric: tabular-nums; }
.cr-big span { color: var(--muted); font-size: 12px; }
.cr-kv { display: grid; grid-template-columns: 1fr 1fr; gap: 6px 10px; margin: 0; padding-top: 8px; border-top: 1px solid var(--line2); }
.cr-kv div { display: grid; gap: 0; min-width: 0; }
.cr-kv dt { color: var(--faint); font-size: 11px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.cr-kv dd { margin: 0; font-size: 12.5px; font-weight: 600; font-variant-numeric: tabular-nums; }

/* ── table ───────────────────────────────────────────── */
.tw { overflow: auto; max-height: 74vh; }
.t { width: 100%; border-collapse: separate; border-spacing: 0; font-variant-numeric: tabular-nums; font-size: 12.5px; }
.t th, .t td { padding: 8px 12px; text-align: right; white-space: nowrap; border-bottom: 1px solid var(--line2); }
.t th { position: sticky; top: 0; z-index: 2; background: var(--head); font-weight: 500; font-size: 12px; color: var(--muted); cursor: pointer; user-select: none; border-bottom-color: var(--line); }
.t th .q { margin-left: 4px; vertical-align: -2px; display: inline-grid; }
.t th:hover, .t th.on { color: var(--ink); }
.t th .ar { margin-left: 3px; color: var(--brand); }
.t th:first-child, .t td:first-child { text-align: left; position: sticky; left: 0; background: var(--card); z-index: 1; }
.t th:first-child { z-index: 3; background: var(--head); }
.t td:first-child { max-width: 320px; min-width: 220px; white-space: normal; }
.t tbody tr:hover td { background: color-mix(in srgb, var(--brand-soft) 50%, var(--card)); }
.t tbody tr.dim td { color: var(--faint); }
.t tbody tr[data-href] { cursor: pointer; }
.t tfoot td { position: sticky; bottom: 0; background: var(--head); font-weight: 600; border-top: 1px solid var(--line); border-bottom: 0; }
.t .em { color: var(--faint); }
.nm { display: flex; align-items: center; gap: 9px; }
.nm div { display: grid; min-width: 0; }
.nm b { font-weight: 500; overflow: hidden; text-overflow: ellipsis; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
.nm small { color: var(--faint); font-size: 11.5px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.th { width: 32px; height: 32px; border-radius: 6px; object-fit: cover; flex: none; background: var(--line2); cursor: zoom-in; }
.th.none { display: grid; place-items: center; color: var(--faint); font-size: 10px; cursor: default; }
.dot { width: 7px; height: 7px; border-radius: 50%; flex: none; background: var(--faint); }
.dot.on { background: var(--good); }
.dot.bad { background: var(--bad); }
.dot.wait { background: var(--warn); }
.bc { display: inline-flex; align-items: center; gap: 8px; justify-content: flex-end; }
.bc i { display: block; width: 44px; height: 4px; border-radius: 2px; background: var(--line2); overflow: hidden; }
.bc i::before { content: ""; display: block; height: 100%; width: var(--w); background: var(--brand); border-radius: 2px; }

/* ── leads list ──────────────────────────────────────── */
.lt th, .lt td { text-align: left; }
.lt th { cursor: default; }
.lt td:first-child { min-width: 110px; max-width: none; color: var(--muted); white-space: nowrap; }
.lt .who { display: grid; }
.lt .who b { font-weight: 500; }
.lt .who small { color: var(--faint); font-size: 11.5px; font-variant-numeric: tabular-nums; }
.lt .nm { min-width: 220px; }
.lt .nm small { display: inline-flex; align-items: center; gap: 4px; flex-wrap: wrap; white-space: normal; }
.lt .msg { color: var(--muted); max-width: 360px; white-space: normal; min-width: 220px; cursor: default; }
.lt-type { display: inline-block; padding: 2px 8px; border-radius: 6px; background: var(--brand-soft); color: var(--brand); font-size: 11.5px; font-weight: 500; }
.lt-type.re { background: var(--line2); color: var(--muted); }
.more-row { display: flex; justify-content: center; margin-top: 12px; }
.lt .deal { display: inline-flex; align-items: center; gap: 8px; }
.lt a.deal:hover .stg { border-color: var(--ink); }
.stg { display: inline-block; padding: 2px 8px; border-radius: 6px; border: 1px solid var(--line); color: var(--muted); font-size: 11.5px; white-space: nowrap; }
.stg.ql { background: var(--brand-soft); border-color: transparent; color: var(--brand); }
.stg.won { background: color-mix(in srgb, var(--good) 14%, var(--card)); border-color: transparent; color: var(--good); font-weight: 600; }
.lt .sum { font-variant-numeric: tabular-nums; }
.stages { margin-bottom: 12px; max-width: 760px; }
.stages .fr:not(.inq) .fbar i { background: var(--faint); }
.stages .fr { height: auto; min-height: 30px; padding: 3px 0; }
.stages .fl { flex-wrap: wrap; white-space: normal; }
.stages .fl small { flex-basis: 100%; color: var(--faint); font-size: 11.5px; padding-left: 18px; }
.stages .ok { font-style: normal; color: var(--brand); font-weight: 700; margin-right: 2px; }
.stages .fr { grid-template-columns: 220px minmax(0, 1fr) 64px 44px; }

/* ── «soon» tabs ─────────────────────────────────────── */
.soon { padding: 20px 22px; display: grid; gap: 10px; max-width: 760px; }
.soon h3 { margin: 0; font-size: 15px; font-weight: 600; }
.soon p { margin: 0; color: var(--muted); }
.soon p b { color: var(--ink); }
.soon ol { margin: 0; padding-left: 18px; display: grid; gap: 4px; }
.chip { justify-self: start; display: inline-block; padding: 2px 8px; border-radius: 6px; background: var(--lime); color: var(--on-lime); font-size: 11px; font-weight: 600; }

/* ── report for the client's management ──────────────── */
.ph-row { display: flex; justify-content: space-between; align-items: flex-end; gap: 12px; flex-wrap: wrap; }
.rp { max-width: 980px; margin: 0 auto; }
.rp-head { display: flex; justify-content: space-between; align-items: flex-end; gap: 12px; flex-wrap: wrap; margin: 6px 0 18px; }
.rp-k { display: inline-block; font-size: 12px; color: var(--muted); letter-spacing: .02em; }
.rp-head h1 { margin: 2px 0 0; font-size: 28px; font-weight: 650; letter-spacing: -.02em; }
.rp-head p { margin: 4px 0 0; color: var(--muted); }
.rp-actions { display: flex; gap: 8px; }
.rp-say { font-size: 17px; line-height: 1.5; margin: 0 0 18px; padding: 16px 18px; border-radius: var(--r); background: var(--brand-soft); color: var(--ink); }
.rp-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; margin-bottom: 22px; }
.rp-c { background: var(--card); border: 1px solid var(--line); border-radius: var(--r); padding: 16px 18px; display: grid; gap: 4px; align-content: start; }
.rp-c span { color: var(--muted); font-size: 13px; }
.rp-c b { font-size: 28px; font-weight: 650; letter-spacing: -.02em; font-variant-numeric: tabular-nums; }
.rp-c.pos b { color: var(--good); }
.rp-c small { color: var(--faint); font-size: 12px; }
.rp h2 { font-size: 16px; font-weight: 600; margin: 0 0 10px; }
.sec { display: flex; align-items: center; gap: 6px; font-size: 15px; font-weight: 600; margin: 22px 2px 10px; }
.all-sum { margin: 12px 2px 0; font-size: 13.5px; line-height: 1.5; color: var(--muted); }
.all-sum b { color: var(--ink); font-weight: 600; }
.seo-k { grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); margin-bottom: 12px; }
.seo-k .mi b { font-size: 18px; }
.rp-t td:first-child { min-width: 260px; }
.rp-note { margin: 10px 2px 0; font-size: 13px; color: var(--muted); }
@media (max-width: 640px) { .rp-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } .rp-c b { font-size: 22px; } }
@media print {
  .top, .no-print, .banner { display: none !important; }
  body { background: #fff; }
  .wrap { padding: 0; }
  .card, .rp-c { box-shadow: none; }
  .tw { max-height: none; overflow: visible; }
}

/* ── login ───────────────────────────────────────────── */
.login { min-height: 100vh; display: grid; place-items: center; padding: 16px; }
.login-card { width: min(360px, 100%); padding: 26px; display: grid; gap: 12px; }
.login-card h1 { margin: 6px 0 0; font-size: 20px; font-weight: 650; }
.login-card p { margin: 0; }
.login-card input { height: 40px; border: 1px solid var(--line); border-radius: 8px; padding: 0 12px; background: var(--bg); }
.login-card .err { color: var(--bad); min-height: 18px; font-size: 12px; }

/* ── picture viewer ──────────────────────────────────── */
.viewer { position: fixed; inset: 0; z-index: 50; background: rgba(8, 14, 12, .7); display: grid; place-items: center; padding: 16px; }
.viewer-in { background: var(--card); border-radius: var(--r); padding: 10px; display: grid; gap: 10px; max-width: min(460px, 100%); }
.viewer img { width: 100%; border-radius: 8px; display: block; }
.viewer-row { display: flex; justify-content: space-between; gap: 10px; align-items: center; }

/* ── narrower screens ────────────────────────────────── */
@media (max-width: 1100px) {
  .kpis { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .kpi:nth-child(4) { border-left: 0; }
  .kpi:nth-child(n+4) { border-top: 1px solid var(--line2); }
  .g2 { grid-template-columns: minmax(0, 1fr); }
  .more { grid-template-columns: repeat(4, minmax(0, 1fr)); }
  .mi:nth-child(5) { border-left: 0; }
  .mi:nth-child(n+5) { border-top: 1px solid var(--line2); }
}
@media (max-width: 760px) {
  .g-money { grid-template-columns: minmax(0, 1fr); }
  .mrow b { font-size: 20px; }
  .stages .fr { grid-template-columns: 150px minmax(0, 1fr) 54px 40px; }
}
@media (max-width: 640px) {
  .top-l { width: 100%; }
  .top-r { width: 100%; }
  .per { flex: 1; min-width: 0; }
  .per-btn { width: 100%; }
  .per-btn .chev { margin-left: auto; }
  .per-menu { left: 0; right: auto; }
  .per-menu.cal { grid-template-columns: minmax(0, 1fr); width: calc(100vw - 32px); }
  .cal-presets { display: flex; overflow-x: auto; scrollbar-width: none; gap: 6px; }
  .cal-presets::-webkit-scrollbar { display: none; }
  .cal-presets button { white-space: nowrap; border: 1px solid var(--line); }
  .cal-grid button { height: 38px; }
  .seg, .icon-btn { flex: none; }
  .ld-w { display: none; }
  .kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .kpi { padding: 10px 12px; }
  .kpi:nth-child(odd) { border-left: 0; }
  .kpi:nth-child(4) { border-left: 1px solid var(--line2); }
  .kpi:nth-child(n+3) { border-top: 1px solid var(--line2); }
  .kpi b { font-size: 18px; }
  .fr { grid-template-columns: 104px minmax(0, 1fr) 60px 40px; gap: 8px; }
  .more { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .mi { padding: 9px 12px; }
  .mi:nth-child(odd) { border-left: 0; }
  .mi:nth-child(even) { border-left: 1px solid var(--line2); }
  .mi:nth-child(n+3) { border-top: 1px solid var(--line2); }
  .search { flex: 1 1 100%; }
  .chips { flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none; max-width: 100%; }
  .chips::-webkit-scrollbar { display: none; }
  .crs { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
  .cr-body { padding: 8px 10px 10px; }
  .t td:first-child { min-width: 170px; max-width: 210px; }
  .ph h1 { font-size: 18px; }
}
