/* Пульт: світло-сірий фон, білі картки з великим заокругленням, градієнтні картки-акценти,
   чорні «пігулки» для головних дій і точкові графіки. Темна тема — тими самими токенами. */
:root {
  --bg: #efeff1;
  --surface: #ffffff;
  --surface-2: #f5f5f7;
  --ink: #0e0e11;
  --ink-2: #3a3a42;
  --muted: #74747d;
  --line: #ebebee;
  --grid: #ececef;
  --dot: #e2e2e7;
  --pill: #0e0e11;
  --on-pill: #ffffff;
  --good: #1a9a52;
  --good-soft: #e2f5e9;
  --bad: #e0434a;
  --bad-soft: #fde9e9;
  --warn: #ef7d22;
  --warn-soft: #fff0e1;
  --violet: #7262ec;
  --violet-soft: #eeebff;
  --blue: #2f7cf0;
  --blue-soft: #e5efff;
  --c-sale: #19a35a;
  --c-search: #ff8a3d;
  --c-ai: #8a6cff;
  --shadow: 0 1px 2px rgba(14, 14, 17, .04), 0 10px 30px rgba(14, 14, 17, .05);
  --glass: rgba(255, 255, 255, .22);
  --bar: #0e0e11;
  --glass-line: rgba(255, 255, 255, .38);
  --display: "Inter Tight", "Inter", -apple-system, "Segoe UI", system-ui, sans-serif;
  --body: "Inter", -apple-system, "Segoe UI", system-ui, sans-serif;
  --mono: ui-monospace, "SF Mono", Menlo, Consolas, monospace;
  --r: 24px;
  --r-s: 16px;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0d0d10; --surface: #17171b; --surface-2: #1f1f25; --ink: #f3f3f5; --ink-2: #c9c9d0; --muted: #9696a0;
    --line: #26262d; --grid: #24242b; --dot: #2b2b33; --pill: #f3f3f5; --on-pill: #0d0d10;
    --good: #4cc983; --good-soft: #15291e; --bad: #ff6b70; --bad-soft: #301a1c; --warn: #ffa057; --warn-soft: #2f2216;
    --violet: #a294ff; --violet-soft: #221f3a; --blue: #6aa5ff; --blue-soft: #16233a;
    --c-sale: #3fd17f; --c-search: #ff9a55; --c-ai: #a28cff;
    --shadow: none;
    --glass: rgba(255, 255, 255, .16); --glass-line: rgba(255, 255, 255, .26);
    --bar: #26262e;
    color-scheme: dark;
  }
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--bg); color: var(--ink); font: 15px/1.5 var(--body); -webkit-font-smoothing: antialiased; }
.num, .mono { font-family: var(--mono); font-variant-numeric: tabular-nums; }
a { color: inherit; }
h1, h2, h3 { text-wrap: balance; }
button { font: inherit; }
:focus-visible { outline: 2px solid var(--ink); outline-offset: 2px; }
i[data-icon] { display: inline-flex; width: 18px; height: 18px; flex: none; }
i[data-icon] svg { width: 100%; height: 100%; }
[hidden] { display: none !important; }

/* ---------- каркас ---------- */
.app { display: grid; grid-template-columns: 252px minmax(0, 1fr); min-height: 100vh; }
.side { position: sticky; top: 0; height: 100vh; background: var(--surface); display: flex; flex-direction: column; padding: 22px 14px 16px; gap: 18px; border-right: 1px solid var(--line); }
.brand { display: flex; align-items: center; gap: 10px; padding: 0 8px; }
.brand b { display: block; font-family: var(--display); font-size: 17px; font-weight: 700; letter-spacing: -.02em; }
.brand small { display: block; font-size: 12px; color: var(--muted); }
.logo { width: 34px; height: 34px; border-radius: 11px; background: #0e0e11 url("/panel/favicon.svg") center / 100% no-repeat; flex: none; }
.nav { display: grid; gap: 2px; }
.nav-sec { margin: 12px 12px 4px; font-size: 11px; font-weight: 600; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); }
.nav-sec:first-child { margin-top: 0; }
.nav a { display: flex; align-items: center; gap: 12px; padding: 9px 12px; border-radius: 12px; color: var(--ink-2); text-decoration: none; font-weight: 500; font-size: 14.5px; }
.nav a:hover { background: var(--surface-2); color: var(--ink); }
.nav a[aria-current="page"] { background: var(--surface-2); color: var(--ink); font-weight: 600; }
.nav a span { flex: 1; }
.badge { font-style: normal; font-size: 11.5px; font-weight: 600; min-width: 22px; text-align: center; padding: 1px 7px; border-radius: 999px; background: var(--pill); color: var(--on-pill); font-variant-numeric: tabular-nums; }
.side-note { margin-top: auto; display: grid; gap: 2px; padding: 14px; border-radius: 18px; background: var(--surface-2); font-size: 12.5px; color: var(--muted); }
.side-note b { color: var(--ink); font-size: 13.5px; }
.side-note-ic { width: 30px; height: 30px; border-radius: 50%; display: grid; place-items: center; color: #fff; margin-bottom: 6px; background: linear-gradient(135deg, #f6339a, #ff8a3d); }
.side-note-ic i { width: 16px; height: 16px; }
.me { display: flex; align-items: center; gap: 10px; padding: 12px 6px 0; border-top: 1px solid var(--line); }
.avatar { width: 34px; height: 34px; border-radius: 50%; color: #fff; display: grid; place-items: center; font-weight: 600; font-size: 13px; flex: none; background: linear-gradient(135deg, #7262ec, #2f7cf0); }
.me-name { flex: 1; min-width: 0; line-height: 1.25; }
.me-name b { display: block; font-size: 14px; }
.me-name small { color: var(--muted); font-size: 12px; }
.icon-btn { background: none; border: 0; color: var(--muted); padding: 7px; border-radius: 10px; cursor: pointer; display: inline-flex; }
.icon-btn:hover { color: var(--ink); background: var(--surface-2); }

.main { min-width: 0; padding: 30px clamp(16px, 3vw, 40px) 64px; max-width: 1400px; width: 100%; }
.vh { display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between; gap: 14px; margin-bottom: 22px; }
.vh h1 { font-family: var(--display); font-weight: 600; font-size: clamp(26px, 3vw, 36px); line-height: 1.1; letter-spacing: -.03em; margin: 0; max-width: 24ch; }
.h-mute { color: var(--muted); }
.sub { margin: 8px 0 0; color: var(--muted); max-width: 72ch; }
.vh-act { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.hint { color: var(--muted); font-size: 13px; margin: 10px 0 0; }

/* ---------- кнопки, чипи, пігулки ---------- */
.pill { display: inline-flex; align-items: center; gap: 8px; height: 40px; padding: 0 16px; border-radius: 999px; background: var(--surface); color: var(--ink); text-decoration: none; font-weight: 600; font-size: 14px; border: 0; cursor: pointer; box-shadow: var(--shadow); }
.pill i { width: 16px; height: 16px; }
.pill.dark { background: var(--pill); color: var(--on-pill); }
.pill:hover { filter: brightness(.97); }
.pill.dark:hover { filter: brightness(1.15); }
.chip { display: inline-flex; align-items: center; gap: 6px; font-size: 12px; font-weight: 500; color: var(--muted); padding: 3px 10px; border-radius: 999px; background: var(--surface-2); white-space: nowrap; text-decoration: none; }
.chip.link:hover { color: var(--ink); }
.round { width: 34px; height: 34px; flex: none; border-radius: 50%; display: grid; place-items: center; background: var(--surface-2); color: var(--ink); text-decoration: none; }
.round i { width: 16px; height: 16px; }
.round.glass { background: var(--glass); color: #fff; box-shadow: inset 0 0 0 1px var(--glass-line); -webkit-backdrop-filter: blur(6px); backdrop-filter: blur(6px); }
.round.dark { background: #0e0e11; color: #fff; }
a.round:hover { filter: brightness(.95); }

.tabs { display: inline-flex; flex-wrap: nowrap; gap: 4px; padding: 4px; background: var(--surface-2); border-radius: 999px; max-width: 100%; overflow-x: auto; scrollbar-width: none; }
.tabs::-webkit-scrollbar { display: none; }
.tabs.wide { display: flex; background: var(--surface); box-shadow: var(--shadow); margin-bottom: 16px; }
.tabs.wide button { flex: 1 1 0; justify-content: center; }
.tabs button { display: inline-flex; align-items: center; gap: 8px; border: 0; background: none; color: var(--muted); padding: 8px 16px; border-radius: 999px; cursor: pointer; font-weight: 600; font-size: 14px; white-space: nowrap; }
.tabs button:hover { color: var(--ink); }
.tabs button[aria-pressed="true"] { background: var(--pill); color: var(--on-pill); }
.tabs .c { font-size: 12px; font-variant-numeric: tabular-nums; min-width: 20px; padding: 0 6px; border-radius: 999px; background: var(--line); color: var(--ink-2); }
.tabs button[aria-pressed="true"] .c { background: rgba(255, 255, 255, .2); color: inherit; }

/* ---------- картки ---------- */
.card { background: var(--surface); border-radius: var(--r); padding: 20px 22px; box-shadow: var(--shadow); min-width: 0; text-decoration: none; color: inherit; }
.card-h { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px; margin-bottom: 12px; }
.card-h.nw { flex-wrap: nowrap; }
.card-h.nw > :first-child { min-width: 0; }
.card-h h2 { font-size: 16px; font-weight: 600; margin: 0; letter-spacing: -.01em; }
.chart { overflow-x: auto; }
.chart svg { display: block; width: 100%; height: auto; }
svg text { fill: var(--muted); font-family: var(--body); font-size: 11px; font-variant-numeric: tabular-nums; }
svg text.v { fill: var(--ink); font-weight: 600; }
svg text.lbl { fill: var(--ink); font-size: 12px; }
svg text.strong { font-weight: 600; }
.empty { background: var(--surface); border-radius: var(--r); padding: 26px; color: var(--muted); box-shadow: var(--shadow); }
.mt { margin-top: 14px; }

/* ---------- градієнти (м'які «меш»-плями) ---------- */
.grad { position: relative; overflow: hidden; color: #fff; isolation: isolate; border: 0; }
.grad::after { content: ""; position: absolute; inset: 0; border-radius: inherit; box-shadow: inset 0 1px 0 rgba(255, 255, 255, .35), inset 0 0 0 1px rgba(255, 255, 255, .12); pointer-events: none; }
.g-violet { background: radial-gradient(120% 90% at 0% 0%, #5a49d6 0%, transparent 60%), radial-gradient(90% 90% at 100% 100%, #7fb2f6 0%, transparent 65%), linear-gradient(150deg, #6f5fe0, #8a90ee 55%, #79a7f0); }
.g-pink { background: radial-gradient(110% 90% at 0% 0%, #ff2f92 0%, transparent 60%), radial-gradient(100% 90% at 100% 100%, #ff9a3d 0%, transparent 60%), linear-gradient(150deg, #f6339a, #ff5b5b 55%, #ff8a3d); }
.g-green { background: radial-gradient(110% 90% at 0% 0%, #22a35b 0%, transparent 60%), radial-gradient(100% 100% at 100% 100%, #f2b33c 0%, transparent 60%), linear-gradient(150deg, #2aa860, #79b84a 55%, #e3a33a); }
.g-blue { background: radial-gradient(110% 90% at 0% 0%, #3d5ff0 0%, transparent 60%), radial-gradient(100% 100% at 100% 100%, #86b9ff 0%, transparent 65%), linear-gradient(150deg, #4466ee, #5f8cf3 55%, #7aaaf7); }
.g-coral { background: radial-gradient(110% 90% at 0% 0%, #ef3b4f 0%, transparent 60%), radial-gradient(100% 100% at 100% 100%, #ff9c7a 0%, transparent 65%), linear-gradient(150deg, #f04456, #f86a64 55%, #ff8c6e); }
.g-orange { background: radial-gradient(110% 90% at 0% 0%, #ff6a1f 0%, transparent 60%), radial-gradient(100% 100% at 100% 100%, #ffc04d 0%, transparent 65%), linear-gradient(150deg, #ff6f2a, #ff9440 55%, #f7b545); }
.grad h2, .grad h3, .grad b { color: #fff; }
.grad small, .grad .g-cap { color: rgba(255, 255, 255, .82); }
.grad { text-shadow: 0 1px 2px rgba(20, 10, 40, .12); }

/* ---------- огляд ---------- */
.ov { display: grid; grid-template-columns: repeat(12, minmax(0, 1fr)); gap: 16px; }
.ring-card { grid-column: span 3; display: flex; flex-direction: column; }
.radar-card { grid-column: span 4; display: flex; flex-direction: column; }
.leads-card { grid-column: span 5; }
.board { grid-column: span 8; }
.ov-side { grid-column: span 4; display: grid; gap: 16px; align-content: start; }
@media (max-width: 1240px) {
  .ring-card, .radar-card { grid-column: span 6; }
  .leads-card, .board { grid-column: span 12; }
  .ov-side { grid-column: span 12; grid-template-columns: repeat(auto-fit, minmax(min(320px, 100%), 1fr)); }
}
@media (max-width: 700px) { .ring-card, .radar-card { grid-column: span 12; } }
/* на телефоні головна дія — першою */
@media (max-width: 860px) { .ov-side { display: contents; } .ov-side > * { grid-column: span 12; } .agent-card { order: -1; } }

.ring { flex: 1; display: grid; place-items: center; padding: 4px 0 10px; }
.ring svg { width: 100%; max-width: 230px; height: auto; display: block; }
.ring svg text.ring-n { font-family: var(--display); font-size: 40px; font-weight: 600; fill: var(--ink); letter-spacing: -.03em; }
.ring svg text.ring-l { font-size: 12px; fill: var(--muted); }
.ring-legend { display: grid; grid-template-columns: 1fr 1fr; gap: 6px 12px; font-size: 13px; color: var(--muted); }
.ring-legend span { display: flex; align-items: center; gap: 7px; }
.ring-legend b { color: var(--ink); margin-left: auto; font-variant-numeric: tabular-nums; }

.d { display: inline-block; width: 8px; height: 8px; border-radius: 50%; flex: none; }
.d-sale { background: var(--c-sale); } .d-search { background: var(--c-search); } .d-ai { background: var(--c-ai); }
.d-wait { background: var(--warn); } .d-work { background: var(--blue); } .d-done { background: var(--good); } .d-no { background: var(--muted); }
.d-good { background: var(--good); } .d-warn { background: var(--warn); } .d-bad { background: var(--bad); }
.gd-0 { background: var(--good); } .gd-1 { background: var(--violet); } .gd-2 { background: var(--warn); }
.dot-legend { display: flex; flex-wrap: wrap; gap: 4px 14px; font-size: 12.5px; color: var(--muted); }
.dot-legend span { display: inline-flex; align-items: center; gap: 6px; }

.g-cap { font-size: 13px; font-weight: 500; }
.g-big { margin: 0; font-family: var(--display); font-size: 34px; font-weight: 600; letter-spacing: -.03em; line-height: 1.1; color: #fff; }
.g-big small { font-family: var(--body); font-size: 13px; font-weight: 500; letter-spacing: 0; margin-left: 8px; }
.radar { flex: 1; display: grid; place-items: center; margin-top: 6px; }
.radar svg { width: 100%; height: auto; display: block; }
.radar svg text { fill: #fff; font-size: 10.5px; }
.radar svg text.rv { fill: rgba(255, 255, 255, .78); font-size: 9.5px; }

.big-row { display: flex; flex-wrap: wrap; align-items: baseline; gap: 6px 12px; margin: -2px 0 8px; }
.big-row .big { font-family: var(--display); font-size: 44px; font-weight: 600; letter-spacing: -.035em; line-height: 1; }
.big-row .delta { font-size: 14px; font-weight: 600; }
.big-row .delta.down { color: var(--bad); } .big-row .delta.up { color: var(--good); }
.big-row .what { color: var(--muted); font-size: 14px; }
.leads-card .chart svg { max-width: 620px; margin-inline: auto; }
.leads-card svg text.mlab { font-size: 11.5px; }
.leads-card svg text.mval { fill: var(--ink); font-weight: 600; font-size: 11.5px; }
.leads-card svg text.tgt { fill: var(--muted); font-size: 11px; font-weight: 600; }

.board-cols { display: grid; grid-template-columns: minmax(0, 1.15fr) minmax(0, 1fr); gap: 26px; margin-top: 16px; }
@media (max-width: 900px) { .board-cols { grid-template-columns: 1fr; } }
.kpis { display: grid; gap: 4px; }
.kgroup-h { display: flex; align-items: center; gap: 8px; font-size: 13px; font-weight: 600; margin: 10px 0 2px; }
.kgroup-h:first-child { margin-top: 0; }
.krow { display: grid; grid-template-columns: 36px minmax(0, 1fr) auto; gap: 12px; align-items: center; padding: 9px 0; }
.krow + .krow { border-top: 1px solid var(--line); }
.k-ic { width: 36px; height: 36px; border-radius: 50%; display: grid; place-items: center; color: #fff; }
.k-ic i { width: 16px; height: 16px; }
.k-ic.bad { background: linear-gradient(135deg, #ff5a63, #e0434a); }
.k-ic.warn { background: linear-gradient(135deg, #ffad5c, #ef7d22); }
.k-ic.ok { background: linear-gradient(135deg, #3fcf7f, #1a9a52); }
.k-txt { min-width: 0; }
.k-txt b { display: block; font-size: 14px; font-weight: 600; line-height: 1.3; }
.k-txt small { display: block; color: var(--muted); font-size: 12.5px; line-height: 1.35; margin-top: 2px; }
.k-val { text-align: right; display: grid; justify-items: end; gap: 4px; }
.k-val b { font-family: var(--display); font-size: 18px; font-weight: 600; letter-spacing: -.02em; white-space: nowrap; }
.tgt-chip { font-size: 11.5px; font-weight: 600; padding: 2px 8px; border-radius: 999px; white-space: nowrap; }
.tgt-chip.bad { background: var(--bad-soft); color: var(--bad); }
/* ---------- посилання на живі сторінки ---------- */
.pc-links, .f-links { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 8px; min-width: 0; }
.pc-links a, .f-links a { display: inline-flex; padding: 4px 12px; border-radius: 999px; background: var(--blue-soft); color: var(--blue); font-family: var(--mono); font-size: 12.5px; font-weight: 600; text-decoration: none; overflow-wrap: anywhere; }
.pc-links a:hover, .f-links a:hover { text-decoration: underline; }
.pl-cap { display: inline-flex; align-items: center; gap: 6px; font-size: 12.5px; font-weight: 600; color: var(--muted); }
.pl-cap i { width: 14px; height: 14px; }
.f-links { margin-top: 6px; }
.f-links .pl-cap { display: none; }
.f-links a { padding: 2px 10px; font-size: 12px; }

/* ---------- звіт агента в картці ---------- */
.f-txt .f-pid { margin-left: 6px; color: var(--ink); font-family: var(--mono); font-size: 12.5px; font-weight: 600; }
.f-title { display: block; font-size: 13px; color: var(--ink-2); margin-top: 2px; overflow-wrap: anywhere; }
.f-rep { display: inline-flex; align-items: center; gap: 6px; margin-top: 6px; padding: 3px 10px; border-radius: 999px; font-size: 12px; font-weight: 600; background: var(--good-soft); color: var(--good); }
.f-rep.warn { background: var(--warn-soft); color: var(--warn); }
.f-rep.bad { background: var(--bad-soft); color: var(--bad); }
.f-rep i { width: 13px; height: 13px; }
.f-det { margin-top: 8px; }
.f-det > summary { cursor: pointer; font-size: 13px; font-weight: 600; color: var(--ink); list-style: none; display: inline-flex; align-items: center; gap: 6px; }
.f-det > summary::-webkit-details-marker { display: none; }
.f-det > summary::before { content: "▸"; color: var(--muted); }
.f-det[open] > summary::before { content: "▾"; }
.f-det > .report { margin-top: 10px; }
.pc-title small .rep-chip { background: var(--good-soft); color: var(--good); font-weight: 600; }
.pc-title small .rep-chip.warn { background: var(--warn-soft); color: var(--warn); }
.pc-title small .rep-chip.bad { background: var(--bad-soft); color: var(--bad); }

.report { display: grid; gap: 12px; padding: 16px; border-radius: var(--r-s); background: var(--surface-2); min-width: 0; }
.report-h { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.report-h b { font-size: 15px; }
.report-h time { margin-left: auto; font-size: 12.5px; color: var(--muted); font-variant-numeric: tabular-nums; }
.report h4 { margin: 4px 0 0; font-size: 11px; font-weight: 600; text-transform: uppercase; letter-spacing: .08em; color: var(--muted); }
.report p { margin: 0; font-size: 14px; max-width: 80ch; overflow-wrap: anywhere; }
.ra-list { margin: 0; padding: 0; list-style: none; counter-reset: ra; display: grid; gap: 10px; }
.ra-list li { counter-increment: ra; display: grid; grid-template-columns: 24px minmax(0, 1fr); gap: 4px 10px; font-size: 14px; }
.ra-list li::before { content: counter(ra); grid-row: span 2; width: 24px; height: 24px; border-radius: 50%; background: var(--pill); color: var(--on-pill); display: grid; place-items: center; font-size: 12px; font-weight: 600; }
.ra-what { display: flex; flex-wrap: wrap; gap: 2px 8px; align-items: baseline; min-width: 0; }
.ra-what small { color: var(--muted); font-size: 12.5px; }
.ra-diff { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(220px, 100%), 1fr)); gap: 6px; min-width: 0; }
.ra-diff span { padding: 8px 12px; border-radius: 12px; background: var(--surface); white-space: pre-line; overflow-wrap: anywhere; font-size: 13.5px; }
.ra-diff .will { background: var(--good-soft); }
.ra-diff small { display: block; font-size: 10.5px; font-weight: 600; text-transform: uppercase; letter-spacing: .08em; color: var(--muted); }
.ra-diff .will small { color: var(--good); }
.checks { margin: 0; padding: 0; list-style: none; display: grid; gap: 6px; font-size: 14px; }
.checks li { display: grid; grid-template-columns: 22px minmax(0, 1fr); gap: 10px; align-items: start; overflow-wrap: anywhere; }
.ck { width: 22px; height: 22px; border-radius: 50%; display: grid; place-items: center; color: #fff; background: linear-gradient(135deg, #3fcf7f, #1a9a52); }
.checks li.bad .ck { background: linear-gradient(135deg, #ff5a63, #e0434a); }
.checks li.warn .ck { background: linear-gradient(135deg, #ffad5c, #ef7d22); }
.ck i { width: 12px; height: 12px; }
.report-files { color: var(--muted); font-size: 12.5px !important; display: flex; flex-wrap: wrap; gap: 4px 8px; }
.report-files .mono { font-family: var(--mono); font-size: 12px; color: var(--ink-2); overflow-wrap: anywhere; }

/* ---------- задачі й питання агенту ---------- */
.ask-form { display: grid; gap: 14px; max-width: 760px; }
.ask-form .tabs { justify-self: start; }
.fld { display: grid; gap: 6px; font-size: 13px; color: var(--muted); font-weight: 500; min-width: 0; }
.fld select, .fld textarea { font: inherit; font-size: 14.5px; color: var(--ink); background: var(--surface-2); border: 0; border-radius: 16px; padding: 12px 16px; width: 100%; min-width: 0; }
.fld select { height: 46px; padding-block: 0; text-overflow: ellipsis; }
.fld textarea { min-height: 110px; resize: vertical; border-radius: 20px; }
.fld select:focus, .fld textarea:focus { outline: 2px solid var(--ink); outline-offset: 0; }
.ask-foot { display: flex; flex-wrap: wrap; gap: 12px; align-items: center; justify-content: space-between; }
.ask-foot .hint { margin: 0; flex: 1 1 260px; }
.asks { display: grid; gap: 10px; max-width: 760px; }
.ask { display: grid; gap: 10px; min-width: 0; }
.ask.flat + .ask.flat { padding-top: 12px; border-top: 1px solid var(--line); }
.ask-h { display: flex; flex-wrap: wrap; gap: 6px 10px; align-items: center; font-size: 13px; color: var(--muted); }
.ask-h b { color: var(--ink); font-size: 14px; }
.ask-h a { color: var(--ink); font-weight: 600; }
.ask-kind, .ask-st { padding: 2px 10px; border-radius: 999px; font-size: 12px; font-weight: 600; }
.ask-kind.t { background: var(--violet-soft); color: var(--violet); }
.ask-kind.q { background: var(--blue-soft); color: var(--blue); }
.ask-st.wait { background: var(--warn-soft); color: var(--warn); }
.ask-st.ok { background: var(--good-soft); color: var(--good); }
.ask-st.off { background: var(--surface-2); color: var(--muted); }
.ask-text { margin: 0; white-space: pre-line; overflow-wrap: anywhere; max-width: 75ch; }
.ask-ans { display: flex; gap: 12px; align-items: flex-start; padding: 12px 14px; border-radius: var(--r-s); background: var(--good-soft); font-size: 14px; }
.ask-ans > div { min-width: 0; display: grid; gap: 6px; justify-items: start; }
.ask-ans b { font-size: 11px; font-weight: 600; color: var(--good); text-transform: uppercase; letter-spacing: .08em; padding-top: 6px; }
.ask-ans p { margin: 0; white-space: pre-line; overflow-wrap: anywhere; }
.ask-act { display: flex; gap: 8px; }
.pc-asks { display: grid; gap: 12px; padding-top: 14px; border-top: 1px solid var(--line); }
a.btn { text-decoration: none; }
a.btn i:last-child:not(:first-child) { width: 14px; height: 14px; }

.tgt-chip.warn { background: var(--warn-soft); color: var(--warn); }
.tgt-chip.ok { background: var(--good-soft); color: var(--good); }

.feed { list-style: none; margin: 0; padding: 0; display: grid; gap: 4px; }
.feed > li { display: grid; grid-template-columns: 34px minmax(0, 1fr) auto; gap: 12px; align-items: start; padding: 8px 0; }
.feed > li + li { border-top: 1px solid var(--line); }
.feed > li.hint { display: block; padding: 0; }
.f-ic { width: 34px; height: 34px; border-radius: 50%; display: grid; place-items: center; color: #fff; font-size: 12px; font-weight: 600; }
.f-ic i { width: 15px; height: 15px; }
.f-ic.new { background: linear-gradient(135deg, #ffad5c, #ef7d22); }
.f-ic.yes { background: linear-gradient(135deg, #3fcf7f, #1a9a52); }
.f-ic.no { background: linear-gradient(135deg, #ff5a63, #e0434a); }
.f-ic.done { background: linear-gradient(135deg, #6aa5ff, #2f7cf0); }
.f-ic.back { background: linear-gradient(135deg, #b4a8ff, #7262ec); }
.f-ic.other { background: var(--surface-2); color: var(--muted); }
.f-txt { min-width: 0; }
.f-txt > b { display: block; font-size: 14px; font-weight: 600; line-height: 1.3; }
.f-txt > small { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; color: var(--muted); font-size: 12.5px; line-height: 1.4; margin-top: 2px; overflow-wrap: anywhere; }
.f-time { font-size: 11.5px; color: var(--muted); white-space: nowrap; font-variant-numeric: tabular-nums; padding-top: 2px; }

.agent-card { display: grid; gap: 18px; padding: 20px; min-height: 230px; align-content: space-between; }
.agent-card:hover { filter: saturate(1.08); }
.ag-top { display: flex; align-items: center; gap: 10px; }
.ag-top > span:nth-child(2) { flex: 1; line-height: 1.25; }
.ag-top b { display: block; font-size: 16px; }
.ag-top small { font-size: 12.5px; }
.ag-ic { width: 40px; height: 40px; border-radius: 50%; display: grid; place-items: center; background: var(--glass); box-shadow: inset 0 0 0 1px var(--glass-line); }
.ag-msg { display: grid; gap: 4px; }
.ag-msg b { font-family: var(--display); font-size: 24px; font-weight: 600; line-height: 1.15; letter-spacing: -.02em; }
.ag-msg span { color: rgba(255, 255, 255, .92); font-size: 13.5px; font-weight: 500; }
.ag-go { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 6px 6px 6px 16px; border-radius: 999px; background: var(--glass); box-shadow: inset 0 0 0 1px var(--glass-line); font-weight: 600; font-size: 14px; -webkit-backdrop-filter: blur(8px); backdrop-filter: blur(8px); }

.last-run p { margin: 0 0 8px; font-weight: 500; }
.last-run ul { margin: 0; padding: 0; list-style: none; display: grid; gap: 6px; color: var(--muted); font-size: 13.5px; }
.last-run li { display: grid; grid-template-columns: 8px 1fr; gap: 10px; align-items: baseline; }
.last-run li::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: var(--c-ai); transform: translateY(-1px); }

.tiles { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.tile { display: flex; flex-direction: column; gap: 2px; padding: 16px; min-height: 168px; border-radius: 22px; }
.tile:hover { filter: saturate(1.1); }
.tile-ic { margin-bottom: auto; width: 32px; height: 32px; border-radius: 50%; display: grid; place-items: center; background: var(--glass); box-shadow: inset 0 0 0 1px var(--glass-line); }
.tile-ic i { width: 16px; height: 16px; }
.tile-cap { margin-top: 12px; font-size: 12.5px; color: rgba(255, 255, 255, .85); line-height: 1.3; }
.tile b { font-family: var(--display); font-size: 26px; font-weight: 600; letter-spacing: -.03em; line-height: 1.1; }
.tile small { font-size: 12px; }

/* ---------- пропозиції ---------- */
.plist { display: grid; gap: 10px; }
.pc { background: var(--surface); border-radius: 22px; box-shadow: var(--shadow); overflow: hidden; }
.pc.focus { box-shadow: 0 0 0 2px var(--ink), var(--shadow); }
.pc-head { width: 100%; text-align: left; background: none; border: 0; color: inherit; cursor: pointer; display: grid; grid-template-columns: auto minmax(0, 1fr) auto; gap: 14px; align-items: center; padding: 16px 18px; }
.pc-head:hover { background: var(--surface-2); }
.kind { width: 42px; height: 42px; border-radius: 50%; display: grid; place-items: center; color: #fff; }
.kind i { width: 18px; height: 18px; }
.kind.k-blue { background: linear-gradient(135deg, #6aa5ff, #2f7cf0); }
.kind.k-orange { background: linear-gradient(135deg, #ffad5c, #ef7d22); }
.kind.k-violet { background: linear-gradient(135deg, #b4a8ff, #7262ec); }
.kind.k-green { background: linear-gradient(135deg, #3fcf7f, #1a9a52); }
.kind.k-pink { background: linear-gradient(135deg, #ff6fb5, #f6339a); }
.kind.k-red { background: linear-gradient(135deg, #ff5a63, #e0434a); }
.kind.k-teal { background: linear-gradient(135deg, #4fd1c5, #1e9d93); }
.pc-title b { display: block; font-size: 15.5px; font-weight: 600; line-height: 1.35; }
.pc-title small { display: flex; flex-wrap: wrap; gap: 4px 6px; color: var(--muted); font-size: 12px; margin-top: 6px; }
.pc-title small > span { padding: 1px 8px; border-radius: 999px; background: var(--surface-2); }
.pc-title small .mono { overflow-wrap: anywhere; }
.pc-title small .appr { background: var(--warn-soft); color: var(--warn); font-weight: 600; }
.pc-title small .stt { background: var(--blue-soft); color: var(--blue); font-weight: 600; }
.chev { width: 34px; height: 34px; border-radius: 50%; display: grid; place-items: center; background: var(--surface-2); color: var(--muted); transition: transform .15s; }
.pc.open .chev { transform: rotate(180deg); }
.pc-body { padding: 2px 18px 18px 74px; display: grid; gap: 14px; }
@media (max-width: 640px) { .pc-body { padding: 0 16px 16px; } .pc-head { padding: 14px 16px; gap: 12px; } .kind { width: 38px; height: 38px; } }
.why { margin: 0; max-width: 75ch; }
.effect { display: flex; gap: 12px; align-items: flex-start; padding: 12px 14px; border-radius: var(--r-s); font-size: 14px; background: var(--good-soft); }
.e-ic { width: 28px; height: 28px; border-radius: 50%; flex: none; display: grid; place-items: center; color: #fff; background: linear-gradient(135deg, #3fcf7f, #1a9a52); }
.e-ic i { width: 14px; height: 14px; }
.effect > span:last-child { padding-top: 3px; }
.diff { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(280px, 100%), 1fr)); gap: 10px; }
.diff div { border-radius: var(--r-s); padding: 12px 14px; white-space: pre-line; overflow-wrap: anywhere; font-size: 14px; background: var(--surface-2); }
.diff .will { background: var(--good-soft); }
.diff b { display: block; font-size: 11px; font-weight: 600; text-transform: uppercase; letter-spacing: .08em; margin-bottom: 4px; color: var(--muted); }
.diff .will b { color: var(--good); }
.steps { margin: 0; padding: 0; list-style: none; counter-reset: s; display: grid; gap: 8px; }
.steps li { counter-increment: s; display: grid; grid-template-columns: 24px 1fr; gap: 10px; font-size: 14px; }
.steps li::before { content: counter(s); width: 24px; height: 24px; border-radius: 50%; background: var(--pill); color: var(--on-pill); display: grid; place-items: center; font-size: 12px; font-weight: 600; }
.act { display: grid; grid-template-columns: minmax(0, 1fr) auto auto; gap: 10px; align-items: end; border-top: 1px solid var(--line); padding-top: 14px; }
@media (max-width: 640px) { .act { grid-template-columns: 1fr 1fr; } .act textarea { grid-column: 1 / -1; } }
.act textarea { min-height: 46px; font: inherit; font-size: 14px; padding: 12px 16px; border: 0; border-radius: 20px; background: var(--surface-2); color: var(--ink); resize: vertical; }
.act textarea:focus { outline: 2px solid var(--ink); outline-offset: 0; }
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; font-weight: 600; border-radius: 999px; height: 46px; padding: 0 20px; cursor: pointer; border: 0; font-size: 14.5px; }
.btn i { width: 16px; height: 16px; }
.btn.yes { background: var(--pill); color: var(--on-pill); }
.btn.yes:hover { filter: brightness(1.2); }
.btn.no { background: var(--surface-2); color: var(--ink); }
.btn.no:hover { background: var(--bad-soft); color: var(--bad); }
.btn.small { height: 34px; padding: 0 14px; font-size: 13px; }
.btn:disabled { opacity: .55; cursor: progress; }
.decided { display: flex; flex-wrap: wrap; gap: 6px 12px; align-items: center; font-size: 13.5px; color: var(--muted); padding-top: 12px; border-top: 1px solid var(--line); }
.decided q { color: var(--ink); }
.confirm { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; font-size: 14px; }
.err { color: var(--bad); font-size: 13px; margin: 0; }

/* ---------- стратегія ---------- */
.goal { border-radius: 28px; padding: 26px 28px; margin-bottom: 16px; display: grid; gap: 18px; }
.goal p { margin: 0; font-family: var(--display); font-size: clamp(19px, 2.2vw, 26px); font-weight: 500; line-height: 1.3; letter-spacing: -.02em; max-width: 52ch; }
.goal-nums { display: flex; flex-wrap: wrap; gap: 10px; }
.goal-nums span { display: grid; padding: 10px 16px; border-radius: 18px; background: var(--glass); box-shadow: inset 0 0 0 1px var(--glass-line); font-size: 12.5px; color: rgba(255, 255, 255, .85); }
.goal-nums b { font-family: var(--display); font-size: 22px; font-weight: 600; letter-spacing: -.02em; }
.choice { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(280px, 100%), 1fr)); gap: 16px; margin-bottom: 16px; }
.choice .card h3 { margin: 0 0 8px; font-size: 16px; font-weight: 600; display: flex; align-items: center; gap: 10px; }
.choice .card h3 .n i { width: 15px; height: 15px; }
.choice .card h3 .n { width: 30px; height: 30px; border-radius: 50%; display: grid; place-items: center; background: var(--pill); color: var(--on-pill); font-size: 13px; flex: none; }
.choice .card p { margin: 0; font-size: 14px; color: var(--muted); }
.layers { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(280px, 100%), 1fr)); gap: 16px; margin-bottom: 16px; }
.layer { padding: 0; overflow: hidden; display: flex; flex-direction: column; }
.layer-top { padding: 18px 20px 16px; display: grid; gap: 8px; min-height: 112px; align-content: space-between; }
.layer-top small { font-size: 14px; font-weight: 500; }
.layer-top b { font-family: var(--display); font-size: 21px; font-weight: 600; letter-spacing: -.02em; line-height: 1.15; }
.layer-top em { font-style: normal; justify-self: start; font-size: 12px; font-weight: 600; padding: 3px 10px; border-radius: 999px; background: var(--glass); box-shadow: inset 0 0 0 1px var(--glass-line); }
.layer > p { margin: 0; padding: 14px 20px 18px; font-size: 14px; color: var(--ink-2); }
.st-charts { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(460px, 100%), 1fr)); gap: 16px; margin-bottom: 16px; }
.legend { display: flex; flex-wrap: wrap; gap: 4px 14px; font-size: 12.5px; color: var(--muted); }
.legend span { display: inline-flex; align-items: center; gap: 6px; }
.sec-h { font-family: var(--display); font-size: 20px; font-weight: 600; letter-spacing: -.02em; margin: 26px 0 12px; }
.clusters { display: grid; gap: 10px; }
.cl { background: var(--surface); border-radius: 22px; box-shadow: var(--shadow); overflow: hidden; }
.cl > summary { list-style: none; cursor: pointer; display: grid; grid-template-columns: 36px minmax(0, 1fr) auto auto; gap: 14px; align-items: center; padding: 14px 18px; }
.cl > summary::-webkit-details-marker { display: none; }
.cl > summary:hover { background: var(--surface-2); }
.cl .pr { width: 34px; height: 34px; border-radius: 50%; background: var(--pill); color: var(--on-pill); display: grid; place-items: center; font-weight: 600; font-size: 13.5px; }
.cl .nm b { display: block; font-weight: 600; }
.cl .nm small { color: var(--muted); font-family: var(--mono); font-size: 11.5px; overflow-wrap: anywhere; }
.cl .dm, .cl .gain { text-align: right; font-size: 12px; color: var(--muted); white-space: nowrap; }
.cl .dm b, .cl .gain b { display: block; font-family: var(--display); color: var(--ink); font-size: 17px; font-weight: 600; letter-spacing: -.02em; }
.cl .gain b { color: var(--good); }
@media (max-width: 640px) { .cl > summary { grid-template-columns: 32px minmax(0, 1fr) auto; padding: 12px 14px; } .cl .gain { display: none; } .cl .pr { width: 30px; height: 30px; } }
.cl-body { padding: 0 18px 16px 68px; display: grid; gap: 10px; }
@media (max-width: 640px) { .cl-body { padding: 0 14px 14px; } }
.cl-note { margin: 0; color: var(--muted); font-size: 13.5px; }
.qt-wrap { overflow-x: auto; }
.qt { width: 100%; border-collapse: collapse; font-size: 14px; min-width: 420px; }
.qt th, .qt td { padding: 8px; border-top: 1px solid var(--line); text-align: left; }
.qt th { font-size: 11px; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); border-top: 0; font-weight: 600; }
.qt .r { text-align: right; white-space: nowrap; font-variant-numeric: tabular-nums; }
.posbar { display: inline-flex; align-items: center; gap: 6px; font-size: 13px; white-space: nowrap; font-variant-numeric: tabular-nums; color: var(--muted); }
.posbar span { padding: 1px 8px; border-radius: 999px; background: var(--surface-2); color: var(--ink); }
.posbar .now { color: var(--muted); }
.posbar .t6 { background: var(--good-soft); color: var(--good); font-weight: 600; }
.method { color: var(--muted); font-size: 13px; margin-top: 14px; max-width: 90ch; }

/* ---------- журнал і правила ---------- */
.two { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(380px, 100%), 1fr)); gap: 16px; align-items: start; }
.diary { display: grid; gap: 16px; }
.diary article { display: grid; gap: 4px; }
.diary time { justify-self: start; font-size: 12px; font-weight: 600; padding: 2px 10px; border-radius: 999px; background: var(--pill); color: var(--on-pill); }
.diary p { margin: 4px 0 2px; font-weight: 500; }
.diary ul { margin: 0; padding: 0; list-style: none; display: grid; gap: 5px; color: var(--muted); font-size: 14px; }
.diary li { display: grid; grid-template-columns: 8px 1fr; gap: 10px; align-items: baseline; }
.diary li::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: var(--c-ai); transform: translateY(-1px); }
.flow-line { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(200px, 100%), 1fr)); gap: 16px; margin-bottom: 16px; }
.flow-line .card { display: grid; gap: 2px; align-content: start; }
.flow-line b { font-size: 15px; font-weight: 600; margin-top: 10px; }
.flow-line .card > span:last-child { color: var(--muted); font-size: 13.5px; }
.fl-n { width: 36px; height: 36px; border-radius: 50%; display: grid; place-items: center; color: #fff; font-weight: 600; }
.cap-wrap { overflow-x: auto; }
table.cap { border-collapse: collapse; width: 100%; min-width: 760px; font-size: 14px; }
table.cap th, table.cap td { text-align: left; vertical-align: top; padding: 12px; border-top: 1px solid var(--line); }
table.cap thead th { border-top: 0; font-size: 11px; color: var(--muted); text-transform: uppercase; letter-spacing: .06em; font-weight: 600; }
table.cap td b { display: block; font-weight: 600; }
.who { display: inline-block; font-size: 12px; padding: 3px 10px; border-radius: 999px; background: var(--blue-soft); color: var(--blue); font-weight: 600; white-space: nowrap; }
.who.v { background: var(--violet-soft); color: var(--violet); }
.who.t { background: var(--warn-soft); color: var(--warn); }
.never { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(240px, 100%), 1fr)); gap: 10px; }
.never div { display: flex; gap: 10px; align-items: flex-start; background: var(--bad-soft); border-radius: var(--r-s); padding: 12px 14px; font-size: 14px; }
.never i { color: var(--bad); width: 16px; height: 16px; margin-top: 2px; }

.toast { position: fixed; right: max(20px, env(safe-area-inset-right, 0px)); bottom: calc(20px + env(safe-area-inset-bottom, 0px)); background: var(--pill); color: var(--on-pill); padding: 12px 18px; border-radius: 999px; font-weight: 600; box-shadow: 0 10px 30px rgba(0, 0, 0, .2); z-index: 30; }

/* ---------- телефон: плаваюча панель вкладок ---------- */
.logout-m { display: none; }
@media (max-width: 860px) {
  .app { grid-template-columns: 1fr; }
  .side { position: fixed; inset: auto max(12px, env(safe-area-inset-right, 0px)) calc(12px + env(safe-area-inset-bottom, 0px)) max(12px, env(safe-area-inset-left, 0px)); top: auto; height: auto; flex-direction: row; padding: 6px; gap: 0; z-index: 20; border: 0; border-radius: 999px; background: var(--bar); box-shadow: 0 12px 30px rgba(0, 0, 0, .3), inset 0 0 0 1px rgba(255, 255, 255, .06); }
  .brand, .me, .side-note, .nav-sec { display: none; }
  .nav { grid-auto-flow: column; grid-auto-columns: 1fr; width: 100%; gap: 2px; }
  .nav a { flex-direction: column; gap: 2px; padding: 7px 2px; font-size: 10.5px; font-weight: 500; position: relative; border-radius: 999px; color: rgba(255, 255, 255, .62); }
  .nav a:hover { background: rgba(255, 255, 255, .08); color: #fff; }
  .nav a[aria-current="page"] { background: #fff; color: #0e0e11; font-weight: 600; }
  .nav a span { flex: none; }
  .badge { position: absolute; top: 2px; left: calc(50% + 5px); padding: 0 5px; min-width: 17px; font-size: 10px; background: #ff5b5b; color: #fff; }
  .main { padding: 20px max(16px, env(safe-area-inset-right, 0px)) calc(104px + env(safe-area-inset-bottom, 0px)) max(16px, env(safe-area-inset-left, 0px)); }
  .vh .logout-m { display: inline-flex; }
  .toast { bottom: calc(92px + env(safe-area-inset-bottom, 0px)); }
  .card { padding: 18px; border-radius: 22px; }
}
@media (max-width: 420px) {
  .tabs.wide button { padding: 8px 10px; font-size: 13px; }
  .tiles { grid-template-columns: 1fr 1fr; gap: 10px; }
  .tile b { font-size: 22px; }
  .big-row .big { font-size: 38px; }
}
@media (prefers-reduced-motion: reduce) { * { transition: none !important; } }

/* ---------- вхід ---------- */
.login-page { display: grid; place-items: center; min-height: 100vh; padding: 16px; background: var(--bg); }
.login { position: relative; width: 100%; max-width: 400px; background: var(--surface); border-radius: 30px; padding: 30px; box-shadow: var(--shadow); overflow: hidden; }
.login-art { height: 120px; margin: -30px -30px 22px; border-radius: 30px 30px 0 0; display: flex; align-items: flex-end; padding: 18px 22px; }
.login-art .logo { width: 46px; height: 46px; border-radius: 14px; box-shadow: 0 6px 20px rgba(0, 0, 0, .2); }
.login h1 { font-family: var(--display); font-size: 26px; font-weight: 600; margin: 0 0 6px; letter-spacing: -.03em; }
.login .note { color: var(--muted); font-size: 14px; margin: 0; }
.login form { display: grid; gap: 8px; margin-top: 20px; }
.login label { font-size: 13px; color: var(--muted); margin-top: 4px; font-weight: 500; }
.login input { font: inherit; height: 48px; padding: 0 16px; border: 0; border-radius: 16px; background: var(--surface-2); color: var(--ink); }
.login input:focus { outline: 2px solid var(--ink); outline-offset: 0; }
.login .btn { margin-top: 12px; width: 100%; }
.login .err { margin-top: 12px; }


/* ========== SMM: огляд, ідеї, брифи, чернетки ========== */
.tiles4 { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 16px; margin-bottom: 16px; }
@media (max-width: 1000px) { .tiles4 { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
.tile4 { border-radius: var(--r); padding: 18px 20px; min-height: 132px; display: flex; flex-direction: column; justify-content: space-between; text-decoration: none; }
.tile4 .g-big { font-size: 40px; }
.tile4 small { font-size: 13px; }
.ov2 { display: grid; grid-template-columns: minmax(0, 1.6fr) minmax(0, 1fr); gap: 16px; }
@media (max-width: 1000px) { .ov2 { grid-template-columns: 1fr; } }
.cal { display: grid; gap: 10px; }
.cal-item { display: grid; grid-template-columns: 64px 56px minmax(0, 1fr) auto; gap: 12px; align-items: center; padding: 8px; border-radius: 16px; text-decoration: none; color: inherit; }
.cal-item:hover { background: var(--surface-2); }
.cal-day { text-align: center; line-height: 1.15; }
.cal-day b { display: block; font-family: var(--display); font-size: 22px; font-weight: 600; }
.cal-day small { color: var(--muted); font-size: 12px; text-transform: capitalize; }
.cal-thumb { width: 56px; height: 70px; border-radius: 10px; object-fit: cover; background: var(--surface-2); }
.cal-t b { display: block; font-size: 14.5px; font-weight: 600; line-height: 1.3; overflow: hidden; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
.cal-t small { color: var(--muted); font-size: 12.5px; }
.todo { margin: 0; padding: 0; list-style: none; display: grid; gap: 8px; }
.todo a { display: flex; align-items: center; gap: 12px; padding: 12px 14px; border-radius: 16px; background: var(--surface-2); text-decoration: none; font-weight: 500; }
.todo a:hover { filter: brightness(.97); }
.todo .n { font-family: var(--display); font-weight: 700; font-size: 20px; min-width: 28px; }
.todo .ok { color: var(--muted); font-size: 14px; padding: 8px 2px; }
.ref { display: inline-flex; align-items: center; gap: 6px; font-size: 13px; color: var(--blue); text-decoration: none; font-weight: 500; }
.ref:hover { text-decoration: underline; }
.row-act { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.metrics { display: flex; flex-wrap: wrap; gap: 6px; }
.metrics span { font-size: 12.5px; padding: 2px 10px; border-radius: 999px; background: var(--surface-2); font-variant-numeric: tabular-nums; }
.metrics .hot { background: var(--warn-soft); color: var(--warn); font-weight: 600; }
.status { font-size: 12px; font-weight: 600; padding: 2px 10px; border-radius: 999px; background: var(--blue-soft); color: var(--blue); }
.status.ok { background: var(--good-soft); color: var(--good); }
.status.no { background: var(--bad-soft); color: var(--bad); }
.brief-grid { display: grid; grid-template-columns: 340px minmax(0, 1fr); gap: 18px; align-items: start; }
@media (max-width: 900px) { .brief-grid { grid-template-columns: 1fr; } }
.embed { width: 100%; height: 560px; border: 0; border-radius: 18px; background: var(--surface-2); }
.blk { display: grid; gap: 6px; }
.blk b.h { font-size: 11px; font-weight: 600; text-transform: uppercase; letter-spacing: .08em; color: var(--muted); }
.blk.keep { padding: 12px 14px; border-radius: var(--r-s); background: var(--violet-soft); }
.blk.keep b.h { color: var(--violet); }
.blk ul { margin: 0; padding-left: 18px; display: grid; gap: 3px; font-size: 14px; }
.scenes { margin: 0; padding: 0; list-style: none; display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 8px; }
.scenes li { padding: 10px 12px; border-radius: 14px; background: var(--surface-2); font-size: 13px; }
.scenes li b { display: block; font-size: 13px; margin-bottom: 2px; }
.slides { display: flex; gap: 10px; overflow-x: auto; padding-bottom: 6px; scroll-snap-type: x mandatory; }
.slides img { height: 300px; aspect-ratio: 4 / 5; object-fit: cover; border-radius: 14px; background: var(--surface-2); cursor: zoom-in; scroll-snap-align: start; flex: none; }
@media (max-width: 640px) { .slides img { height: 240px; } }
.caption { position: relative; white-space: pre-wrap; font-size: 14px; line-height: 1.55; padding: 14px 16px; border-radius: var(--r-s); background: var(--surface-2); max-height: 340px; overflow: auto; }
.issues { padding: 10px 14px; border-radius: var(--r-s); background: var(--warn-soft); color: var(--warn); font-size: 13.5px; }
.facts { font-size: 13px; color: var(--muted); }
.form-row { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.form-row input, .form-row select, .form-row textarea { font: inherit; font-size: 14px; padding: 10px 14px; border: 0; border-radius: 16px; background: var(--surface-2); color: var(--ink); }
.form-row textarea { flex: 1 1 260px; min-height: 44px; resize: vertical; }
.form-row input { flex: 1 1 260px; }
.links { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 12px; }
.linkcard { display: grid; gap: 4px; }
.linkcard b { font-size: 16px; }
.linkcard small { color: var(--muted); }
.viewer { border: 0; padding: 0; background: transparent; max-width: 96vw; max-height: 96vh; }
.viewer::backdrop { background: rgba(0, 0, 0, .75); }
.viewer img { max-width: 92vw; max-height: 90vh; border-radius: 16px; display: block; }
.viewer .icon-btn { position: absolute; top: 8px; right: 8px; background: rgba(0, 0, 0, .5); color: #fff; }
.toast { position: fixed; left: 50%; bottom: 24px; transform: translateX(-50%); background: var(--pill); color: var(--on-pill); padding: 12px 18px; border-radius: 999px; font-weight: 500; font-size: 14px; z-index: 50; box-shadow: 0 10px 30px rgba(0, 0, 0, .25); max-width: calc(100vw - 32px); }
.toast.err { background: var(--bad); color: #fff; }
.empty-s { color: var(--muted); padding: 22px; background: var(--surface); border-radius: var(--r); box-shadow: var(--shadow); }
.ref-slides img { height: 340px; }
@media (max-width: 900px) { .ref-slides img { height: 260px; } }

/* ========== SMM v2: сьогодні, голос аудиторії, радар, конвеєр, результати ========== */
.goals { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 16px; margin-bottom: 16px; }
@media (max-width: 1000px) { .goals { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
.goal-t { border-radius: var(--r); padding: 18px 20px; background: var(--surface); box-shadow: var(--shadow); display: grid; gap: 6px; align-content: start; min-height: 150px; }
.goal-t small { color: var(--muted); font-size: 13px; font-weight: 500; }
.goal-t .gv { font-family: var(--display); font-size: 34px; font-weight: 600; letter-spacing: -.02em; line-height: 1.1; }
.goal-t .gv span { font-size: 16px; color: var(--muted); font-weight: 500; margin-left: 4px; }
.goal-t .gs { font-size: 12.5px; color: var(--muted); }
.gbar { position: relative; height: 8px; border-radius: 99px; background: var(--surface-2); overflow: hidden; margin-top: 4px; }
.gbar > i { position: absolute; inset: 0 auto 0 0; border-radius: 99px; background: var(--good); width: 0; height: auto; display: block; }
.gbar.warn > i { background: var(--warn); }
.gbar.bad > i { background: var(--bad); }
.today2 { display: grid; grid-template-columns: minmax(0, 1.5fr) minmax(0, 1fr); gap: 16px; }
@media (max-width: 1000px) { .today2 { grid-template-columns: 1fr; } }
.week { display: grid; grid-template-columns: repeat(auto-fill, minmax(120px, 1fr)); gap: 10px; }
.slot { border-radius: 18px; padding: 10px; display: grid; gap: 8px; text-decoration: none; color: inherit; background: var(--surface-2); min-height: 170px; align-content: start; }
.slot.empty { background: transparent; border: 1.5px dashed var(--dot); }
.slot.miss { border-color: var(--bad); }
.slot .sd { font-size: 12.5px; color: var(--muted); font-weight: 500; text-transform: capitalize; }
.slot img, .slot .ph { width: 100%; aspect-ratio: 4 / 5; object-fit: cover; border-radius: 12px; background: var(--dot); display: block; }
.slot b { font-size: 13px; line-height: 1.3; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.slot .st { font-size: 11.5px; font-weight: 600; }
.slot .st.ok { color: var(--good); } .slot .st.pl { color: var(--blue); } .slot .st.no { color: var(--bad); }
.mini-list { display: grid; gap: 8px; }
.mini { display: grid; grid-template-columns: 44px minmax(0, 1fr) auto; gap: 12px; align-items: center; padding: 8px; border-radius: 16px; background: var(--surface-2); text-decoration: none; color: inherit; border: 0; text-align: left; width: 100%; cursor: pointer; }
.mini:hover { filter: brightness(.97); }
.mini img, .mini .ph { width: 44px; height: 55px; border-radius: 9px; object-fit: cover; background: var(--dot); display: grid; place-items: center; color: var(--muted); }
.mini b { font-size: 14px; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; line-height: 1.3; }
.mini small { color: var(--muted); font-size: 12px; }
.tag { font-size: 11.5px; font-weight: 600; padding: 2px 9px; border-radius: 999px; background: var(--blue-soft); color: var(--blue); white-space: nowrap; }
.tag.v { background: var(--violet-soft); color: var(--violet); }
.tag.ok { background: var(--good-soft); color: var(--good); }
.tag.warn { background: var(--warn-soft); color: var(--warn); }
.tag.bad { background: var(--bad-soft); color: var(--bad); }
.tag.mute { background: var(--surface-2); color: var(--muted); }

/* Голос аудиторії */
.themes { display: grid; gap: 10px; }
.theme { display: grid; grid-template-columns: minmax(0, 1fr) 92px auto; gap: 14px; align-items: center; padding: 14px 18px; border-radius: 20px; background: var(--surface); box-shadow: var(--shadow); }
.theme .tl b { font-size: 15.5px; font-weight: 600; display: block; line-height: 1.35; }
.theme .tl small { color: var(--muted); font-size: 12.5px; display: flex; flex-wrap: wrap; gap: 4px 10px; margin-top: 3px; }
.theme .tn { text-align: right; line-height: 1.1; }
.theme .tn b { font-family: var(--display); font-size: 26px; font-weight: 600; display: block; }
.theme .tn small { font-size: 12px; color: var(--muted); }
.theme .tn .up { color: var(--bad); font-weight: 600; }
.theme .ta { display: flex; gap: 6px; align-items: center; justify-content: flex-end; }
.theme.compact { box-shadow: none; background: var(--surface-2); padding: 10px 14px; }
.theme.compact + .theme.compact { margin-top: 8px; }
.theme.dim { opacity: .55; }
@media (max-width: 640px) { .theme { grid-template-columns: minmax(0, 1fr) auto; } .theme .ta { grid-column: 1 / -1; justify-content: flex-start; } }
.srcs { display: grid; gap: 8px; }
.src { display: grid; grid-template-columns: 10px minmax(0, 1fr) auto; gap: 12px; align-items: center; font-size: 14px; padding: 6px 0; }
.src small { color: var(--muted); display: block; font-size: 12.5px; }
.src code { font-family: var(--mono); font-size: 12px; background: var(--surface-2); padding: 1px 6px; border-radius: 6px; }
.empty-voice { padding: 22px; border-radius: var(--r); background: var(--surface); box-shadow: var(--shadow); color: var(--ink-2); display: grid; gap: 8px; }

/* Радар і пости — сітка превʼю */
.grid-cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 14px; }
.gc { border-radius: 20px; background: var(--surface); box-shadow: var(--shadow); overflow: hidden; display: grid; grid-template-rows: auto 1fr; }
.gc .pic { position: relative; aspect-ratio: 4 / 5; background: var(--surface-2); display: grid; place-items: center; color: var(--muted); font-size: 13px; text-align: center; padding: 0; }
.gc .pic img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; cursor: zoom-in; }
.gc .pic .badge2 { position: absolute; top: 10px; left: 10px; z-index: 1; font-size: 12px; font-weight: 700; padding: 3px 10px; border-radius: 999px; background: rgba(14, 14, 17, .78); color: #fff; }
.gc .pic .txt { padding: 18px; font-family: var(--display); font-size: 17px; font-weight: 600; color: var(--ink-2); line-height: 1.3; }
.gc .gb { padding: 12px 14px 14px; display: grid; gap: 8px; align-content: start; }
.gc .gb b { font-size: 14px; line-height: 1.35; }
.gc .gb small { color: var(--muted); font-size: 12.5px; }
.gc .gb .why { font-size: 13px; margin: 0; }
.gc .gb .row-act { margin-top: 2px; }
.posts .gc .pic { aspect-ratio: 1; }

/* Конвеєр */
.kanban { display: grid; grid-template-columns: repeat(5, minmax(200px, 1fr)); gap: 12px; overflow-x: auto; padding-bottom: 8px; }
.col { background: var(--surface); border-radius: 22px; box-shadow: var(--shadow); padding: 12px; display: grid; gap: 8px; align-content: start; min-height: 220px; }
.col-h { display: flex; align-items: center; justify-content: space-between; padding: 2px 4px 6px; }
.col-h b { font-size: 14px; }
.col-h .c { font-size: 12px; font-weight: 600; color: var(--muted); }
.col.hot { outline: 2px solid var(--violet); outline-offset: -2px; }
.col .mini { grid-template-columns: 40px minmax(0, 1fr); }
.col .mini small { display: block; }
@media (max-width: 860px) { .kanban { grid-template-columns: repeat(5, 78vw); scroll-snap-type: x mandatory; } .col { scroll-snap-align: start; } }
.detail { margin-top: 16px; }
.detail .pc { box-shadow: 0 0 0 2px var(--violet), var(--shadow); }

/* Результати */
.res-groups { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 16px; }
.bars { display: grid; gap: 8px; }
.bar-row { display: grid; grid-template-columns: minmax(0, 1fr) 56px; gap: 10px; align-items: center; font-size: 13.5px; }
.bar-row .bl { display: grid; gap: 4px; }
.bar-row .bl span { display: flex; justify-content: space-between; gap: 8px; }
.bar-row .bl small { color: var(--muted); }
.bar-row .bt { height: 8px; border-radius: 99px; background: var(--surface-2); overflow: hidden; }
.bar-row .bt i { display: block; height: 100%; width: 0; border-radius: 99px; background: var(--violet); }
.bar-row b { text-align: right; font-family: var(--display); font-size: 18px; }
.nav a .f, .nav a .s { font-weight: inherit; }
.nav a .s { display: none; }
@media (max-width: 860px) { .nav a .f { display: none; } .nav a .s { display: inline; } }
