@font-face {
  font-family: "Flex";
  src: url("/static/fonts/roboto-flex-cyrillic-wdth-normal.woff2") format("woff2");
  font-weight: 100 1000; font-stretch: 25% 151%; font-display: swap;
  unicode-range: U+0301, U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116;
}
@font-face {
  font-family: "Flex";
  src: url("/static/fonts/roboto-flex-latin-wdth-normal.woff2") format("woff2");
  font-weight: 100 1000; font-stretch: 25% 151%; font-display: swap;
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

:root {
  --paper: #F3F4F6;
  --surface: #FFFFFF;
  --ink: #15171C;
  --ink-2: #5B6170;
  --ink-3: #8A90A0;
  --line: #DFE2E8;
  --line-strong: #C5CAD3;
  --accent: #2B36D9;
  --accent-ink: #FFFFFF;
  --accent-soft: #E6E8FC;
  --danger: #C2253B;
  --warn: #B86E00;
  --ok: #1F7A4D;
  /* типы кампаний — цвет несёт смысл */
  --c-drop: #15171C;
  --c-drop-ink: #FFFFFF;
  --c-sample_sale: #F6C2CE;
  --c-digital_sale: #FFD45E;
  --c-campaign: #CFCAF7;
  --c-pr: #CFCAF7;
  --c-charity: #B4DEC9;
  --c-event: #DCE0E7;
  --c-sale: #FFD45E;
  --c-other: #DCE0E7;
  --tile: #E7E9EE;
  --shadow-sheet: 0 -8px 40px rgba(21, 23, 28, .16);
  --radius-sheet: 22px;
  --radius-field: 10px;
  --nav-h: 64px;
  --safe-b: env(safe-area-inset-bottom, 0px);
  --safe-t: env(safe-area-inset-top, 0px);
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --paper: #101216; --surface: #191C22; --ink: #EDEFF3; --ink-2: #A3A9B6; --ink-3: #737A89;
    --line: #2A2E37; --line-strong: #3A3F4A; --accent: #7C85FF; --accent-ink: #0E1030; --accent-soft: #23264A;
    --c-drop: #EDEFF3; --c-drop-ink: #101216; --c-sample_sale: #6E3A47; --c-digital_sale: #6B5718; --c-campaign: #3F3A72;
    --c-pr: #3F3A72; --c-charity: #2C5A45; --c-event: #343943; --c-sale: #6B5718; --c-other: #343943; --tile: #232730;
    --danger: #FF6B80; --warn: #F0A43A; --ok: #5BC48C; color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --paper: #101216; --surface: #191C22; --ink: #EDEFF3; --ink-2: #A3A9B6; --ink-3: #737A89;
  --line: #2A2E37; --line-strong: #3A3F4A; --accent: #7C85FF; --accent-ink: #0E1030; --accent-soft: #23264A;
  --c-drop: #EDEFF3; --c-drop-ink: #101216; --c-sample_sale: #6E3A47; --c-digital_sale: #6B5718; --c-campaign: #3F3A72;
  --c-pr: #3F3A72; --c-charity: #2C5A45; --c-event: #343943; --c-sale: #6B5718; --c-other: #343943; --tile: #232730;
  --danger: #FF6B80; --warn: #F0A43A; --ok: #5BC48C; color-scheme: dark;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; background: var(--paper); color: var(--ink);
  font-family: "Flex", system-ui, -apple-system, "Segoe UI", sans-serif;
  font-size: 15px; line-height: 1.45; font-stretch: 100%;
  -webkit-font-smoothing: antialiased; -webkit-tap-highlight-color: transparent;
}
a { color: inherit; }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: 4px; }
img { max-width: 100%; display: block; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }

/* ---------- оболочка ---------- */
.shell { display: grid; grid-template-columns: 232px 1fr; min-height: 100vh; }
.rail {
  position: sticky; top: 0; height: 100vh; padding: 22px 14px; border-right: 1px solid var(--line);
  display: flex; flex-direction: column; gap: 2px; background: var(--paper);
}
.brand { display: flex; align-items: baseline; gap: 6px; padding: 0 10px 22px; text-decoration: none; }
.brand b { font-stretch: 40%; font-weight: 900; font-size: 30px; letter-spacing: -.01em; line-height: 1; }
.brand span { color: var(--accent); font-weight: 600; font-size: 14px; }
.rail a.nav {
  display: flex; align-items: center; gap: 12px; padding: 9px 10px; border-radius: 10px;
  text-decoration: none; color: var(--ink-2); font-weight: 500;
}
.rail a.nav svg { width: 20px; height: 20px; flex: none; }
.rail a.nav:hover { background: var(--surface); color: var(--ink); }
.rail a.nav[aria-current="page"] { background: var(--ink); color: var(--paper); }
.rail .group { margin: 16px 10px 6px; color: var(--ink-3); font-size: 12px; }
.rail .me { margin-top: auto; padding: 10px; font-size: 13px; color: var(--ink-2); display: flex; justify-content: space-between; align-items: center; gap: 8px; }
.rail .me button { background: none; border: 0; color: var(--ink-3); padding: 0; }

main.view { padding: 28px 36px 60px; max-width: 1240px; width: 100%; min-width: 0; }
.pulse-grid > *, .board > * { min-width: 0; }
html, body { overflow-x: hidden; }
.tabbar { display: none; }

.head { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; margin-bottom: 22px; flex-wrap: wrap; }
.head h1 { margin: 0; font-size: 34px; line-height: 1; font-stretch: 45%; font-weight: 800; letter-spacing: -.01em; }
.head p { margin: 6px 0 0; color: var(--ink-2); }
.head .actions { display: flex; gap: 8px; flex-wrap: wrap; }

/* ---------- кнопки, поля ---------- */
.btn {
  display: inline-flex; align-items: center; gap: 8px; border: 1px solid var(--line-strong);
  background: var(--surface); padding: 9px 14px; border-radius: 999px; font-weight: 600; font-size: 14px; white-space: nowrap;
}
.btn:hover { border-color: var(--ink-2); }
.btn.primary { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }
.btn.dark { background: var(--ink); border-color: var(--ink); color: var(--paper); }
.btn.ghost { background: transparent; border-color: transparent; }
.btn.danger { color: var(--danger); }
.btn svg { width: 18px; height: 18px; }
.btn:disabled { opacity: .5; cursor: default; }
.seg { display: inline-flex; background: var(--surface); border: 1px solid var(--line); border-radius: 999px; padding: 3px; }
.seg button { white-space: nowrap; border: 0; background: none; padding: 6px 14px; border-radius: 999px; font-weight: 600; font-size: 13px; color: var(--ink-2); }
.seg button[aria-pressed="true"] { background: var(--ink); color: var(--paper); }

.field { display: grid; gap: 5px; }
.field > span { font-size: 13px; color: var(--ink-2); font-weight: 500; }
.input, select.input, textarea.input {
  width: 100%; border: 1px solid var(--line-strong); background: var(--surface); border-radius: var(--radius-field);
  padding: 10px 12px; font-size: 16px; min-height: 44px;
}
textarea.input { min-height: 96px; resize: vertical; line-height: 1.45; }
.input:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.check { display: flex; gap: 10px; align-items: center; min-height: 44px; }
.check input { width: 20px; height: 20px; accent-color: var(--accent); }
.search { max-width: 280px; }

/* ---------- чипы/метки ---------- */
.tag { display: inline-flex; align-items: center; gap: 6px; padding: 3px 10px; border-radius: 999px; font-size: 12.5px; font-weight: 600; background: var(--c-event); color: var(--ink); white-space: nowrap; }
.tag.t-drop { background: var(--c-drop); color: var(--c-drop-ink); }
.tag.t-sample_sale { background: var(--c-sample_sale); }
.tag.t-digital_sale, .tag.t-sale { background: var(--c-digital_sale); }
.tag.t-campaign, .tag.t-pr { background: var(--c-campaign); }
.tag.t-charity { background: var(--c-charity); }
.dot { width: 8px; height: 8px; border-radius: 50%; display: inline-block; flex: none; background: var(--ink-3); }
.st-done, .st-published, .st-approved, .st-closed, .st-paid, .st-active, .st-running, .st-live { --st: var(--ok); }
.st-doing, .st-review, .st-shoot, .st-edit, .st-ready, .st-shipped, .st-content, .st-cmo, .st-lidia, .st-checked { --st: var(--warn); }
.st-todo, .st-idea, .st-agreed, .st-draft, .st-plan, .st-planned { --st: var(--ink-3); }
.st-inactive, .st-stopped, .st-cancelled, .st-rejected { --st: var(--danger); }
.status { display: inline-flex; align-items: center; gap: 6px; font-size: 13px; color: var(--ink-2); white-space: nowrap; }
.status::before { content: ""; width: 8px; height: 8px; border-radius: 50%; background: var(--st, var(--ink-3)); }
.muted { color: var(--ink-2); }
.faint { color: var(--ink-3); }
.num { font-variant-numeric: tabular-nums; }

/* ---------- Пульс ---------- */
.hero {
  position: relative; padding: 26px 28px 24px; border-radius: 26px; background: var(--ink); color: var(--paper);
  overflow: hidden; margin-bottom: 28px; text-decoration: none; display: block;
}
.hero .kicker { color: color-mix(in oklab, var(--paper) 62%, transparent); font-size: 14px; }
.hero .drop {
  font-stretch: 25%; font-weight: 900; font-size: clamp(56px, 11vw, 132px); line-height: .86;
  letter-spacing: -.005em; margin: 12px 0 18px; overflow-wrap: anywhere; text-transform: uppercase;
}
.hero .meta { display: flex; gap: 22px; flex-wrap: wrap; font-size: 14px; }
.hero .meta b { display: block; font-stretch: 60%; font-size: 30px; line-height: 1.05; font-weight: 800; }
.hero .count { position: absolute; right: 26px; top: 22px; text-align: right; }
.hero .count b { font-stretch: 30%; font-weight: 900; font-size: 64px; line-height: .9; display: block; color: var(--accent-soft); }
.hero .count span { font-size: 13px; color: color-mix(in oklab, var(--paper) 62%, transparent); }
@media (prefers-reduced-motion: no-preference) {
  .hero .drop { animation: rise .7s cubic-bezier(.2, .7, .1, 1) both; }
  @keyframes rise { from { transform: translateY(18px); opacity: 0; } to { transform: none; opacity: 1; } }
}

.pulse-grid { display: grid; grid-template-columns: 1.25fr 1fr; gap: 32px; align-items: start; }
.block h2 { font-size: 20px; font-stretch: 60%; font-weight: 800; margin: 0 0 10px; display: flex; justify-content: space-between; align-items: baseline; gap: 10px; }
.block h2 a { font-size: 13px; font-stretch: 100%; font-weight: 600; color: var(--accent); text-decoration: none; }
.block + .block { margin-top: 30px; }
.rows { border-top: 1px solid var(--line); }
.row { display: grid; grid-template-columns: auto 1fr auto; gap: 14px; align-items: center; padding: 12px 2px; border-bottom: 1px solid var(--line); text-decoration: none; }
.row:hover { background: color-mix(in oklab, var(--surface) 70%, transparent); }
.row .when { font-stretch: 55%; font-weight: 700; font-size: 17px; min-width: 52px; font-variant-numeric: tabular-nums; }
.row .what { min-width: 0; }
.row .what b { font-weight: 600; display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.row .what small { color: var(--ink-2); font-size: 13px; }
.alert { display: flex; gap: 12px; align-items: flex-start; padding: 12px 2px; border-bottom: 1px solid var(--line); text-decoration: none; }
.alert i { width: 4px; align-self: stretch; border-radius: 4px; background: var(--ink-3); flex: none; }
.alert.high i { background: var(--danger); }
.alert.mid i { background: var(--warn); }
.empty { padding: 18px 2px; color: var(--ink-2); }
.stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 0; border-top: 1px solid var(--line); }
.stat { padding: 14px 2px; border-bottom: 1px solid var(--line); }
.stat b { display: block; font-stretch: 35%; font-weight: 900; font-size: 40px; line-height: 1; font-variant-numeric: tabular-nums; }
.stat span { font-size: 13px; color: var(--ink-2); }
.notice { border: 1px dashed var(--line-strong); border-radius: 14px; padding: 14px 16px; color: var(--ink-2); font-size: 14px; }
.notice b { color: var(--ink); }

/* ---------- Календарь ---------- */
.cal-nav { display: flex; align-items: center; gap: 8px; }
.cal-nav .month { font-stretch: 45%; font-weight: 800; font-size: 26px; min-width: 190px; text-transform: capitalize; }
.cal { border-top: 1px solid var(--line); border-left: 1px solid var(--line); background: var(--surface); border-radius: 0; }
.cal-week { display: grid; grid-template-columns: repeat(7, 1fr); position: relative; }
.cal-dow { display: grid; grid-template-columns: repeat(7, 1fr); font-size: 12px; color: var(--ink-3); padding: 0 0 6px; }
.cal-dow div { padding-left: 8px; }
.cal-day { min-height: 128px; border-right: 1px solid var(--line); border-bottom: 1px solid var(--line); padding: 6px 6px 8px; position: relative; }
.cal-day .n { font-size: 13px; font-weight: 600; color: var(--ink-2); font-variant-numeric: tabular-nums; }
.cal-day.out .n { color: var(--ink-3); opacity: .55; }
.cal-day.today .n { background: var(--accent); color: var(--accent-ink); border-radius: 999px; padding: 1px 7px; }
.cal-bars { position: absolute; inset: 28px 0 auto 0; display: grid; grid-template-columns: repeat(7, 1fr); grid-auto-rows: 24px; row-gap: 3px; pointer-events: none; }
.bar {
  pointer-events: auto; margin: 0 3px; border-radius: 6px; padding: 0 8px; display: flex; align-items: center; gap: 6px;
  font-size: 12.5px; font-weight: 700; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; text-decoration: none;
  background: var(--c-event); color: var(--ink); border: 0; text-align: left;
}
.bar.t-drop { background: var(--c-drop); color: var(--c-drop-ink); font-stretch: 70%; letter-spacing: .01em; text-transform: uppercase; }
.bar.t-sample_sale { background: var(--c-sample_sale); }
.bar.t-digital_sale, .bar.t-sale { background: var(--c-digital_sale); }
.bar.t-campaign, .bar.t-pr { background: var(--c-campaign); }
.bar.t-charity { background: var(--c-charity); }
.bar.stage { background: transparent; border: 1px dashed var(--line-strong); color: var(--ink-2); font-weight: 500; }
.cal-more { font-size: 12px; color: var(--ink-2); position: absolute; bottom: 4px; left: 8px; }
.legend { display: flex; gap: 8px; flex-wrap: wrap; margin: 14px 0 0; }
.agenda { border-top: 1px solid var(--line); }
.agenda .day { display: grid; grid-template-columns: 64px 1fr; gap: 10px; padding: 12px 2px; border-bottom: 1px solid var(--line); }
.agenda .day .d { font-stretch: 40%; font-weight: 800; font-size: 26px; line-height: 1; }
.agenda .day .d small { display: block; font-size: 12px; font-stretch: 100%; font-weight: 500; color: var(--ink-3); }
.agenda .items { display: grid; gap: 6px; }

/* ---------- Карточка кампании ---------- */
.camp-head { padding: 26px 28px; border-radius: 24px; background: var(--c-event); margin-bottom: 22px; }
.camp-head.t-drop { background: var(--c-drop); color: var(--c-drop-ink); }
.camp-head.t-sample_sale { background: var(--c-sample_sale); }
.camp-head.t-digital_sale, .camp-head.t-sale { background: var(--c-digital_sale); }
.camp-head.t-campaign, .camp-head.t-pr { background: var(--c-campaign); }
.camp-head.t-charity { background: var(--c-charity); }
.camp-head h1 { font-stretch: 25%; font-weight: 900; font-size: clamp(48px, 9vw, 104px); line-height: .88; margin: 10px 0 12px; text-transform: uppercase; overflow-wrap: anywhere; }
.camp-head .slogan { font-size: 18px; max-width: 60ch; margin: 0; opacity: .9; }
.camp-head .line { display: flex; gap: 10px 18px; flex-wrap: wrap; font-size: 14px; opacity: .85; align-items: center; }
.camp-head .btn { background: transparent; border-color: currentColor; color: inherit; }
.tabs { display: flex; gap: 4px; overflow-x: auto; border-bottom: 1px solid var(--line); margin-bottom: 18px; scrollbar-width: none; }
.tabs button { border: 0; background: none; padding: 10px 12px; font-weight: 600; color: var(--ink-2); border-bottom: 2px solid transparent; white-space: nowrap; }
.tabs button[aria-selected="true"] { color: var(--ink); border-color: var(--ink); }
.tabs button sup { color: var(--ink-3); font-weight: 500; margin-left: 2px; }
.checklist { border-top: 1px solid var(--line); }
.ck { display: grid; grid-template-columns: 28px 1fr auto auto; gap: 12px; align-items: center; padding: 10px 2px; border-bottom: 1px solid var(--line); }
.ck input { width: 22px; height: 22px; accent-color: var(--ok); }
.ck.done .t { text-decoration: line-through; color: var(--ink-3); }
.ck .t small { display: block; color: var(--ink-2); font-size: 13px; }
.progress { height: 6px; border-radius: 6px; background: color-mix(in oklab, currentColor 18%, transparent); overflow: hidden; width: 160px; }
.progress i { display: block; height: 100%; background: currentColor; }

/* ---------- Контент: лента ---------- */
.phone { max-width: 470px; margin: 0 auto; background: var(--surface); border: 1px solid var(--line); border-radius: 28px; overflow: hidden; }
.phone .ig-head { padding: 18px 18px 10px; display: flex; gap: 14px; align-items: center; }
.phone .ava { width: 64px; height: 64px; border-radius: 50%; background: var(--ink); color: var(--paper); display: grid; place-items: center; font-stretch: 40%; font-weight: 900; font-size: 18px; }
.phone .ig-head b { display: block; }
.feed { display: grid; grid-template-columns: repeat(3, 1fr); gap: 2px; }
.tile {
  aspect-ratio: 4 / 5; background: var(--tile); position: relative; overflow: hidden; border: 0; padding: 0; text-align: left;
  display: flex; flex-direction: column; justify-content: flex-end; color: var(--ink);
}
.tile img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.tile .cap { position: relative; padding: 8px; font-stretch: 35%; font-weight: 800; font-size: 17px; line-height: .95; text-transform: uppercase; overflow-wrap: anywhere; }
.tile .meta { position: absolute; top: 6px; left: 8px; right: 6px; display: flex; justify-content: space-between; font-size: 11px; font-weight: 600; color: var(--ink-2); }
.tile.t-drop { background: var(--c-drop); color: var(--c-drop-ink); }
.tile.t-drop .meta { color: color-mix(in oklab, var(--c-drop-ink) 70%, transparent); }
.tile.t-sample_sale { background: var(--c-sample_sale); }
.tile.t-digital_sale { background: var(--c-digital_sale); }
.tile.t-campaign, .tile.t-pr { background: var(--c-campaign); }
.tile.t-charity { background: var(--c-charity); }
.tile.planned::after { content: ""; position: absolute; inset: 0; border: 2px dashed var(--accent); pointer-events: none; }
.tile .fmt { width: 16px; height: 16px; }
.feed-day { grid-column: 1 / -1; padding: 10px 12px 6px; font-size: 12px; color: var(--ink-3); background: var(--surface); }

.week { display: grid; grid-template-columns: 74px repeat(7, minmax(120px, 1fr)); border-top: 1px solid var(--line); border-left: 1px solid var(--line); background: var(--surface); overflow-x: auto; }
.week > div { border-right: 1px solid var(--line); border-bottom: 1px solid var(--line); padding: 6px; min-height: 64px; }
.week .wh { font-size: 12px; color: var(--ink-2); font-weight: 600; min-height: auto; }
.week .wh.today { color: var(--accent); }
.week .slot { font-stretch: 55%; font-weight: 700; color: var(--ink-2); }
.cell-add { width: 100%; height: 100%; min-height: 52px; border: 1px dashed transparent; background: none; border-radius: 8px; color: var(--ink-3); font-size: 20px; }
.cell-add:hover { border-color: var(--line-strong); color: var(--ink); }
.cell-add.miss { border-color: color-mix(in oklab, var(--danger) 50%, transparent); color: var(--danger); font-size: 12px; }
.pchip { display: block; width: 100%; text-align: left; border: 0; border-radius: 8px; padding: 6px 8px; font-size: 12.5px; background: var(--paper); margin-bottom: 4px; }
.pchip b { display: block; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* ---------- Задачи ---------- */
.board { display: grid; grid-template-columns: repeat(4, minmax(240px, 1fr)); gap: 14px; align-items: start; overflow-x: auto; }
.col { background: color-mix(in oklab, var(--surface) 55%, var(--paper)); border-radius: 18px; padding: 10px; min-height: 120px; }
.col.drop-target { outline: 2px dashed var(--accent); }
.col h3 { margin: 4px 6px 10px; font-size: 15px; display: flex; justify-content: space-between; }
.col h3 span { color: var(--ink-3); font-weight: 500; }
.card { background: var(--surface); border: 1px solid var(--line); border-radius: 12px; padding: 11px 12px; margin-bottom: 8px; cursor: grab; text-align: left; width: 100%; display: block; }
.card:active { cursor: grabbing; }
.card b { font-weight: 600; display: block; margin-bottom: 6px; line-height: 1.3; }
.card .line { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; font-size: 12.5px; color: var(--ink-2); }
.card .urgent { color: var(--danger); font-weight: 700; }
.card .over { color: var(--danger); }

/* ---------- таблицы ---------- */
.table-wrap { overflow-x: auto; border-top: 1px solid var(--line); }
table.t { width: 100%; border-collapse: collapse; font-size: 14px; }
table.t th { text-align: left; font-weight: 500; color: var(--ink-3); font-size: 12.5px; padding: 10px 10px 8px 2px; white-space: nowrap; border-bottom: 1px solid var(--line); }
table.t td { padding: 11px 10px 11px 2px; border-bottom: 1px solid var(--line); vertical-align: top; }
table.t tr.click { cursor: pointer; }
table.t tr.click:hover td { background: color-mix(in oklab, var(--surface) 75%, transparent); }
table.t td.r, table.t th.r { text-align: right; }
table.t tfoot td { font-weight: 700; border-bottom: 0; }
.mono { font-variant-numeric: tabular-nums; }
.handle { font-weight: 600; }
.bar-fill { height: 6px; background: var(--line); border-radius: 6px; overflow: hidden; min-width: 80px; }
.bar-fill i { display: block; height: 100%; background: var(--accent); }
.bar-fill.over i { background: var(--danger); }

.filters { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; margin-bottom: 14px; }

/* ---------- лист/модалка ---------- */
.scrim { position: fixed; inset: 0; background: rgba(16, 18, 22, .38); z-index: 40; }
.sheet {
  position: fixed; z-index: 41; top: 0; right: 0; height: 100%; width: min(560px, 100%); background: var(--surface);
  box-shadow: -10px 0 40px rgba(16, 18, 22, .18); display: flex; flex-direction: column;
}
@media (prefers-reduced-motion: no-preference) {
  .sheet { animation: slidein .24s cubic-bezier(.2, .7, .1, 1); }
  @keyframes slidein { from { transform: translateX(40px); opacity: .4; } to { transform: none; opacity: 1; } }
}
.sheet header { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 18px 20px 12px; border-bottom: 1px solid var(--line); }
.sheet header h2 { margin: 0; font-size: 22px; font-stretch: 55%; font-weight: 800; }
.sheet .body { padding: 18px 20px 24px; overflow-y: auto; display: grid; gap: 14px; align-content: start; flex: 1; }
.sheet footer { display: flex; gap: 8px; justify-content: space-between; padding: 12px 20px calc(12px + var(--safe-b)); border-top: 1px solid var(--line); }
.sheet .grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.icon-btn { width: 40px; height: 40px; border-radius: 50%; border: 0; background: var(--paper); display: grid; place-items: center; }
.icon-btn svg { width: 20px; height: 20px; }
.cover-prev { width: 100%; max-width: 220px; aspect-ratio: 4/5; object-fit: cover; border-radius: 10px; background: var(--tile); }
.comments { border-top: 1px solid var(--line); padding-top: 14px; display: grid; gap: 10px; }
.comment { font-size: 14px; }
.comment small { color: var(--ink-3); display: block; }

#toast { position: fixed; left: 50%; bottom: calc(24px + var(--safe-b)); transform: translateX(-50%); background: var(--ink); color: var(--paper); padding: 10px 16px; border-radius: 999px; font-weight: 600; font-size: 14px; z-index: 60; opacity: 0; pointer-events: none; transition: opacity .2s; }
#toast.show { opacity: 1; }
#toast.error { background: var(--danger); color: #fff; }

/* ---------- вход ---------- */
.login { min-height: 100vh; display: grid; grid-template-columns: 1.1fr 1fr; }
.login .art { background: var(--ink); color: var(--paper); padding: 40px; display: flex; flex-direction: column; justify-content: space-between; overflow: hidden; }
.login .art .word { font-stretch: 25%; font-weight: 900; font-size: clamp(80px, 13vw, 190px); line-height: .82; text-transform: uppercase; }
.login .art p { color: color-mix(in oklab, var(--paper) 65%, transparent); max-width: 36ch; }
.login form { align-self: center; justify-self: center; width: min(360px, 100% - 40px); display: grid; gap: 14px; }
.login form h1 { margin: 0 0 6px; font-stretch: 45%; font-size: 34px; font-weight: 800; }
.err { color: var(--danger); font-size: 14px; min-height: 20px; }

/* ---------- «Ще» (меню на телефоне) ---------- */
.more-list { display: grid; border-top: 1px solid var(--line); }
.more-list a { display: flex; align-items: center; gap: 14px; padding: 15px 4px; border-bottom: 1px solid var(--line); text-decoration: none; font-weight: 600; font-size: 16px; }
.more-list a svg { width: 22px; height: 22px; color: var(--ink-2); }
.more-list a small { margin-left: auto; color: var(--ink-3); font-weight: 500; }

.src { display: grid; grid-template-columns: 1fr auto; gap: 10px; padding: 12px 2px; border-bottom: 1px solid var(--line); align-items: center; }
.src b { display: block; }
.src small { color: var(--ink-2); }

/* ---------- телефон ---------- */
@media (max-width: 900px) {
  .shell { grid-template-columns: 1fr; }
  .rail { display: none; }
  main.view { padding: calc(14px + var(--safe-t)) 16px calc(var(--nav-h) + var(--safe-b) + 28px); }
  .tabbar {
    display: grid; grid-template-columns: repeat(5, 1fr); position: fixed; left: 0; right: 0; bottom: 0; z-index: 30;
    background: color-mix(in oklab, var(--surface) 92%, transparent); backdrop-filter: blur(16px); -webkit-backdrop-filter: blur(16px);
    border-top: 1px solid var(--line); padding-bottom: var(--safe-b);
  }
  .tabbar a { display: grid; justify-items: center; gap: 2px; padding: 8px 0 7px; font-size: 11px; font-weight: 600; text-decoration: none; color: var(--ink-3); min-height: var(--nav-h); align-content: center; }
  .tabbar a svg { width: 24px; height: 24px; }
  .tabbar a[aria-current="page"] { color: var(--ink); }
  .head h1 { font-size: 30px; }
  .head .actions .btn { padding: 8px 12px; font-size: 13px; }
  .hero { padding: 22px 20px; border-radius: 22px; }
  .hero .count { position: static; text-align: left; margin-top: 18px; }
  .hero .count b { font-size: 48px; }
  .hero .meta { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; font-size: 12.5px; line-height: 1.25; }
  .hero .meta b { font-size: 26px; }
  .hero .count { display: flex; align-items: baseline; gap: 8px; margin: 0 0 16px; }
  .pulse-grid { grid-template-columns: 1fr; gap: 28px; }
  .stats { grid-template-columns: repeat(2, 1fr); }
  .cal-desktop { display: none; }
  .board { grid-template-columns: 1fr; overflow: visible; }
  .board .col[hidden] { display: none; }
  .sheet { top: auto; bottom: 0; height: auto; max-height: 92vh; width: 100%; border-radius: var(--radius-sheet) var(--radius-sheet) 0 0; box-shadow: var(--shadow-sheet); }
  @media (prefers-reduced-motion: no-preference) {
    .sheet { animation: slideup .26s cubic-bezier(.2, .7, .1, 1); }
    @keyframes slideup { from { transform: translateY(60px); opacity: .4; } to { transform: none; opacity: 1; } }
  }
  .sheet .grid2 { grid-template-columns: 1fr; }
  .phone { border-radius: 20px; }
  .login { grid-template-columns: 1fr; grid-template-rows: auto 1fr; }
  .login .art { padding: calc(28px + var(--safe-t)) 24px 28px; }
  .login .art .word { font-size: 92px; }
  .camp-head { padding: 22px 20px; }
  .week { grid-template-columns: 56px repeat(7, 132px); }
  .ck { grid-template-columns: 28px 1fr auto; }
  .ck .who { display: none; }
  .hide-m { display: none; }
}
@media (min-width: 901px) {
  .cal-mobile { display: none; }
  .board-tabs { display: none; }
  .only-m { display: none; }
}

/* ---------- аналітика ---------- */
.tips { display: grid; gap: 8px; }
.tip { padding: 11px 14px 11px 16px; border-radius: 12px; background: var(--surface); border: 1px solid var(--line); position: relative; }
.tip::before { content: ""; position: absolute; left: 0; top: 10px; bottom: 10px; width: 4px; border-radius: 4px; background: var(--ink-3); }
.tip-good::before { background: var(--ok); }
.tip-warn::before { background: var(--warn); }
.tip-idea::before { background: var(--accent); }
.kpis { display: grid; grid-template-columns: repeat(auto-fill, minmax(210px, 1fr)); gap: 0; border-top: 1px solid var(--line); }
.kpi { padding: 14px 10px 14px 2px; border-bottom: 1px solid var(--line); display: grid; gap: 2px; align-content: start; position: relative; color: var(--ink); }
.kpi .kl { font-size: 13px; color: var(--ink-2); }
.kpi .kv { font-stretch: 35%; font-weight: 900; font-size: 38px; line-height: 1.05; font-variant-numeric: tabular-nums; }
.kpi .kd { font-size: 13px; }
.kpi .spark { width: 100%; max-width: 160px; height: 24px; margin-top: 6px; color: var(--accent); }
.up { color: var(--ok); font-weight: 600; }
.down { color: var(--danger); font-weight: 600; }
.charts { display: grid; grid-template-columns: repeat(auto-fill, minmax(420px, 1fr)); gap: 16px; }
.chart-card { margin: 0; background: var(--surface); border: 1px solid var(--line); border-radius: 16px; padding: 14px 14px 6px; }
.chart-card figcaption { font-weight: 600; font-size: 14px; margin-bottom: 4px; }
.chart { width: 100%; height: auto; display: block; color: var(--ink-2); }
.chart .ax { font-size: 11px; fill: var(--ink-3); font-family: inherit; }
.chart-tip { position: fixed; z-index: 70; pointer-events: none; background: var(--ink); color: var(--paper); padding: 7px 10px; border-radius: 8px; font-size: 13px; line-height: 1.35; display: none; white-space: nowrap; }
.heat { display: grid; gap: 3px; overflow-x: auto; }
.heat-row { display: grid; grid-template-columns: 34px repeat(24, minmax(12px, 1fr)); gap: 3px; align-items: center; }
.heat-row > span:first-child { font-size: 12px; }
.heat-head span { font-size: 10px; color: var(--ink-3); }
.heat .cell { aspect-ratio: 1; border-radius: 3px; background: var(--line); }
.hbars { display: grid; gap: 8px; }
.hbar { display: grid; grid-template-columns: minmax(110px, 38%) 1fr auto; gap: 10px; align-items: center; font-size: 14px; }
.hb-l { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.hb-t { height: 12px; background: color-mix(in oklab, var(--line) 70%, transparent); border-radius: 4px; overflow: hidden; }
.hb-t i { display: block; height: 100%; background: var(--accent); border-radius: 0 4px 4px 0; }
.hb-v { color: var(--ink-2); min-width: 64px; text-align: right; }
.top-posts { display: grid; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); gap: 14px; }
.tp { text-decoration: none; display: grid; gap: 8px; }
.tp-img { aspect-ratio: 4/5; border-radius: 12px; overflow: hidden; background: var(--tile); display: grid; place-items: center; color: var(--ink-3); }
.tp-img img { width: 100%; height: 100%; object-fit: cover; }
.tp-meta { display: grid; gap: 1px; font-size: 13px; }
.tp-meta b { font-size: 15px; }
.connect { display: grid; grid-template-columns: repeat(auto-fill, minmax(360px, 1fr)); gap: 16px; }
.conn { background: var(--surface); border: 1px solid var(--line); border-radius: 18px; padding: 18px; display: grid; gap: 10px; align-content: start; }
.conn-head { display: flex; justify-content: space-between; align-items: center; gap: 10px; }
.conn-head h3 { margin: 0; font-stretch: 55%; font-weight: 800; font-size: 22px; }
@media (max-width: 900px) {
  .charts, .connect { grid-template-columns: 1fr; }
  .kpis { grid-template-columns: repeat(2, 1fr); }
  .kpi .kv { font-size: 30px; }
  .top-posts { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 900px) {
  .ot thead { display: none; }
  .ot tr { display: grid; grid-template-columns: 1fr auto; gap: 6px 12px; padding: 12px 2px; border-bottom: 1px solid var(--line); align-items: start; }
  table.t.ot td { border: 0; padding: 0; }
  .ot td.contact, .ot td.city { grid-column: 1 / -1; }
  .ot td.contact { order: 3; max-width: none !important; }
  .ot td.city { order: 2; color: var(--ink-2); font-size: 13px; }
  .ot td:last-child { grid-row: 1; grid-column: 2; }
}
