/* Otello brand: lime #A7FC26, pink #FF4D90, deep green #084008, ink #1B1C1D */
@font-face { font-family: "Oswald"; font-weight: 600; font-display: swap; src: url(/static/fonts/oswald-cyrillic-600-normal.woff2) format("woff2"); unicode-range: U+0301,U+0400-045F,U+0490-0491,U+04B0-04B1,U+2116; }
@font-face { font-family: "Oswald"; font-weight: 600; font-display: swap; src: url(/static/fonts/oswald-latin-600-normal.woff2) format("woff2"); unicode-range: U+0000-00FF,U+0131,U+0152-0153,U+02BB-02BC,U+02C6,U+02DA,U+02DC,U+2000-206F,U+20AC,U+2122,U+2191,U+2193,U+2212,U+2215,U+FEFF,U+FFFD; }
@font-face { font-family: "Oswald"; font-weight: 700; font-display: swap; src: url(/static/fonts/oswald-cyrillic-700-normal.woff2) format("woff2"); unicode-range: U+0301,U+0400-045F,U+0490-0491,U+04B0-04B1,U+2116; }
@font-face { font-family: "Oswald"; font-weight: 700; font-display: swap; src: url(/static/fonts/oswald-latin-700-normal.woff2) format("woff2"); unicode-range: U+0000-00FF,U+0131,U+0152-0153,U+02BB-02BC,U+02C6,U+02DA,U+02DC,U+2000-206F,U+20AC,U+2122,U+2191,U+2193,U+2212,U+2215,U+FEFF,U+FFFD; }
@font-face { font-family: "Golos Text"; font-weight: 400; font-display: swap; src: url(/static/fonts/golos-text-cyrillic-400-normal.woff2) format("woff2"); unicode-range: U+0301,U+0400-045F,U+0490-0491,U+04B0-04B1,U+2116; }
@font-face { font-family: "Golos Text"; font-weight: 400; font-display: swap; src: url(/static/fonts/golos-text-latin-400-normal.woff2) format("woff2"); unicode-range: U+0000-00FF,U+0131,U+0152-0153,U+02BB-02BC,U+02C6,U+02DA,U+02DC,U+2000-206F,U+20AC,U+2122,U+2191,U+2193,U+2212,U+2215,U+FEFF,U+FFFD; }
@font-face { font-family: "Golos Text"; font-weight: 500; font-display: swap; src: url(/static/fonts/golos-text-cyrillic-500-normal.woff2) format("woff2"); unicode-range: U+0301,U+0400-045F,U+0490-0491,U+04B0-04B1,U+2116; }
@font-face { font-family: "Golos Text"; font-weight: 500; font-display: swap; src: url(/static/fonts/golos-text-latin-500-normal.woff2) format("woff2"); unicode-range: U+0000-00FF,U+0131,U+0152-0153,U+02BB-02BC,U+02C6,U+02DA,U+02DC,U+2000-206F,U+20AC,U+2122,U+2191,U+2193,U+2212,U+2215,U+FEFF,U+FFFD; }
@font-face { font-family: "Golos Text"; font-weight: 600; font-display: swap; src: url(/static/fonts/golos-text-cyrillic-600-normal.woff2) format("woff2"); unicode-range: U+0301,U+0400-045F,U+0490-0491,U+04B0-04B1,U+2116; }
@font-face { font-family: "Golos Text"; font-weight: 600; font-display: swap; src: url(/static/fonts/golos-text-latin-600-normal.woff2) format("woff2"); unicode-range: U+0000-00FF,U+0131,U+0152-0153,U+02BB-02BC,U+02C6,U+02DA,U+02DC,U+2000-206F,U+20AC,U+2122,U+2191,U+2193,U+2212,U+2215,U+FEFF,U+FFFD; }

:root {
  --lime: #A7FC26;
  --lime-soft: #F1FEDE;
  --lime-mid: #DDFBB2;
  --pink: #FF4D90;
  --pink-soft: #FFE3EE;
  --green: #084008;
  --ink: #1B1C1D;
  --muted: #6A6B6B;
  --line: #E6E7E3;
  --line-strong: #CFD1CB;
  --bg: #FFFFFF;
  --surface: #F6F7F4;
  --weekend: #F7F9F2;
  --label-w: 300px;
  --row-h: 46px;
  --head-h: 58px;
  --display: "Oswald", "Arial Narrow", Impact, sans-serif;
  --text: "Golos Text", -apple-system, "Segoe UI", Roboto, Arial, sans-serif;
}

* { box-sizing: border-box; }
html, body { margin: 0; }
body { background: var(--bg); color: var(--ink); font: 400 14px/1.4 var(--text); -webkit-font-smoothing: antialiased; }
button, input { font: inherit; color: inherit; }
a { color: inherit; }
[hidden] { display: none !important; }
.muted { color: var(--muted); }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }

/* ---------- brand atoms ---------- */
.logo { display: inline-block; height: 26px; aspect-ratio: 984 / 256; background: var(--green);
  -webkit-mask: url(/static/logo.svg) no-repeat center / contain; mask: url(/static/logo.svg) no-repeat center / contain; flex: none; }
.tag { display: inline-block; font: 700 13px/1 var(--display); text-transform: uppercase; letter-spacing: .02em;
  padding: 6px 10px 5px; text-decoration: none; white-space: nowrap;
  clip-path: polygon(0 10%, 100% 0, 99% 100%, 1% 92%); }
.tag-lime { background: var(--lime); color: var(--green); }
.tag-pink { background: var(--pink); color: #fff; }
.tag-ink { background: var(--ink); color: var(--lime); }

.btn { display: inline-flex; align-items: center; gap: 6px; border: 0; border-radius: 10px; padding: 8px 14px;
  font-weight: 600; cursor: pointer; background: var(--surface); transition: background .15s, transform .15s; white-space: nowrap; }
.btn:hover { background: var(--lime-mid); }
.btn:active { transform: translateY(1px); }
.btn:focus-visible, .segmented button:focus-visible, .chip:focus-visible { outline: 3px solid var(--pink); outline-offset: 2px; }
.btn-ghost { background: transparent; }
.btn-ghost:hover { background: var(--surface); }
.btn-pink { background: var(--pink); color: #fff; }
.btn-pink:hover { background: #ff2f7c; }
.btn-lime { background: var(--lime); color: var(--green); }
.btn-lime:hover { background: #98ef12; }
.btn-big { font: 700 18px/1 var(--display); text-transform: uppercase; letter-spacing: .03em; padding: 16px 20px; justify-content: center; }
.btn.is-loading svg { animation: spin .8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

/* ---------- top bar ---------- */
.topbar { display: flex; align-items: center; justify-content: space-between; gap: 16px; flex-wrap: wrap;
  padding: 18px 28px 14px; border-bottom: 1px solid var(--line); }
.brand { display: flex; align-items: center; gap: 16px; flex-wrap: wrap; min-width: 0; }
.brand h1 { margin: 0; font: 700 30px/1 var(--display); text-transform: uppercase; letter-spacing: -.005em; }
.segmented.seg-space button { font: 700 15px/1 var(--display); text-transform: uppercase; letter-spacing: .02em; padding: 9px 14px 8px; }
.segmented.seg-space button.is-active { background: var(--lime); color: var(--green); }
.kaiten-link { font-size: 13px; font-weight: 600; color: var(--muted); text-decoration: none; }
.kaiten-link:hover { color: var(--green); text-decoration: underline; }
.sync { display: flex; align-items: center; gap: 4px; flex-wrap: wrap; }
.sync form { margin: 0; }
.sync-status { color: var(--muted); font-size: 13px; margin-right: 6px; }
.sync-status.is-stale { color: var(--pink); font-weight: 600; }

.banner { margin: 12px 28px 0; padding: 12px 16px; border-radius: 12px; background: var(--pink-soft); color: #8a0f3d; font-weight: 500; }

/* ---------- controls ---------- */
.controls { display: flex; align-items: center; gap: 12px 22px; flex-wrap: wrap; padding: 16px 28px 6px; }
.control-group { display: flex; align-items: center; gap: 10px; }
.control-label { font: 600 12px/1 var(--display); text-transform: uppercase; letter-spacing: .06em; color: var(--muted); white-space: nowrap; }
.segmented { display: inline-flex; background: var(--surface); border-radius: 12px; padding: 3px; }
.segmented button { border: 0; background: transparent; padding: 7px 14px; border-radius: 9px; cursor: pointer; font-weight: 600; color: var(--muted); }
.segmented button:hover { color: var(--ink); }
.segmented button.is-active { background: var(--ink); color: var(--lime); }
.switch { display: inline-flex; align-items: center; gap: 10px; cursor: pointer; font-weight: 600; user-select: none; }
.switch input { position: absolute; opacity: 0; pointer-events: none; }
.switch-track { width: 40px; height: 24px; border-radius: 99px; background: var(--line-strong); position: relative; transition: background .15s; flex: none; }
.switch-thumb { position: absolute; top: 3px; left: 3px; width: 18px; height: 18px; border-radius: 50%; background: #fff; transition: transform .15s; box-shadow: 0 1px 2px rgba(0,0,0,.2); }
.switch input:checked + .switch-track { background: var(--green); }
.switch input:checked + .switch-track .switch-thumb { transform: translateX(16px); background: var(--lime); }
.switch input:focus-visible + .switch-track { outline: 3px solid var(--pink); outline-offset: 2px; }
.search { margin-left: auto; flex: 0 1 240px; min-width: 160px; border: 1.5px solid var(--line-strong); border-radius: 10px; padding: 8px 12px; background: #fff; }
.search:focus { outline: none; border-color: var(--green); box-shadow: 0 0 0 3px var(--lime-mid); }

.filters { padding: 6px 28px 14px; display: grid; gap: 8px; }
.filter-row { display: flex; align-items: center; gap: 12px; }
.filter-row .control-label { width: 128px; flex: none; }
.chips { display: flex; flex-wrap: wrap; gap: 6px; }
.chip { display: inline-flex; align-items: center; gap: 7px; border: 1.5px solid var(--line-strong); background: #fff; border-radius: 99px;
  padding: 5px 12px 5px 8px; cursor: pointer; font-weight: 500; font-size: 13px; transition: opacity .15s, background .15s; }
.chip .dot { width: 12px; height: 12px; border-radius: 4px; flex: none; }
.chip .count { color: var(--muted); font-size: 12px; }
.chip.is-off { opacity: .45; background: var(--surface); }
.chip.is-off .dot { filter: grayscale(1); }
.chip.chip-channel { padding-left: 12px; }
.chip.chip-channel.is-on { background: var(--ink); color: var(--lime); border-color: var(--ink); }
.chip.chip-reset { border-style: dashed; color: var(--muted); padding-left: 12px; }

/* ---------- timeline ---------- */
.timeline-wrap { padding: 0 28px 24px; }
.tl-scroll { position: relative; overflow: auto; max-height: calc(100vh - 250px); min-height: 280px; border: 1px solid var(--line); border-radius: 16px; background: #fff; outline: none; }
.tl { position: relative; min-width: 100%; }
.tl-head { position: sticky; top: 0; z-index: 6; display: flex; background: #fff; border-bottom: 1.5px solid var(--ink); height: var(--head-h); }
.tl-corner { position: sticky; left: 0; z-index: 7; width: var(--label-w); flex: none; background: #fff; border-right: 1px solid var(--line);
  display: flex; align-items: flex-end; padding: 0 16px 9px; font: 600 12px/1 var(--display); text-transform: uppercase; letter-spacing: .06em; color: var(--muted); }
.tl-scale { position: relative; flex: none; }
.tl-scale .top, .tl-scale .bottom { position: absolute; left: 0; right: 0; }
.tl-scale .top { top: 0; height: 30px; }
.tl-scale .bottom { top: 30px; height: 28px; }
.tl-cell { position: absolute; top: 0; bottom: 0; display: flex; align-items: center; padding: 0 8px; white-space: nowrap; overflow: hidden; border-left: 1px solid var(--line); }
.top .tl-cell { font: 700 15px/1 var(--display); text-transform: uppercase; letter-spacing: .02em; }
.top .tl-cell { overflow: visible; }
.top .tl-cell span { position: sticky; left: calc(var(--label-w) + 8px); }
.bottom .tl-cell { font-size: 12px; color: var(--muted); justify-content: center; padding: 0 2px; }
.bottom .tl-cell.is-weekend { color: #a6a8a2; }
.bottom .tl-cell.is-today { color: var(--pink); font-weight: 700; }

.tl-grid { position: absolute; top: var(--head-h); bottom: 0; pointer-events: none; z-index: 0; }
.tl-grid .vl { position: absolute; top: 0; bottom: 0; width: 1px; background: var(--line); }
.tl-grid .vl.major { background: var(--line-strong); }
.tl-grid .we { position: absolute; top: 0; bottom: 0; background: var(--weekend); }
.tl-grid .past { position: absolute; top: 0; bottom: 0; left: 0; background: repeating-linear-gradient(135deg, rgba(27,28,29,.025) 0 6px, transparent 6px 12px); }
.today-line { position: absolute; top: var(--head-h); bottom: 0; width: 2px; background: var(--pink); z-index: 0; pointer-events: none; }
.today-mark { position: absolute; bottom: -1.5px; width: 0; height: 0; border-left: 7px solid transparent; border-right: 7px solid transparent; border-bottom: 8px solid var(--pink); transform: translateX(-50%); }

.tl-group { position: relative; z-index: 1; display: flex; height: 44px; }
.tl-group .gl { position: sticky; left: 0; z-index: 3; width: var(--label-w); flex: none; display: flex; align-items: center; gap: 10px; padding: 0 14px;
  background: #fff; border-right: 1px solid var(--line); }
.tl-group .gl .tag { font-size: 15px; }
.tl-group .gl .n { color: var(--muted); font-size: 12px; font-weight: 600; }
.tl-group .gt { flex: none; }
.tl-group:not(.is-first) .gt { border-top: 1px solid var(--line-strong); }
.tl-group:not(.is-first) .gl { border-top: 1px solid var(--line-strong); }

.tl-row { position: relative; z-index: 1; display: flex; height: var(--row-h); }
.tl-row:hover .rl, .tl-row.is-hover .rl { background: var(--lime-soft); }
.tl-row .rl { position: sticky; left: 0; z-index: 3; width: var(--label-w); flex: none; display: flex; flex-direction: column; justify-content: center;
  padding: 0 14px 0 16px; background: #fff; border-right: 1px solid var(--line); cursor: pointer; min-width: 0; }
.tl-row .rl .t { display: flex; align-items: center; gap: 6px; font-weight: 600; min-width: 0; }
.tl-row .rl .tn { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; min-width: 0; }
.kinds { display: inline-flex; gap: 3px; flex: none; }
.kind { display: inline-grid; place-items: center; width: 20px; height: 20px; border-radius: 6px; background: var(--lime); color: var(--green); }
.kind svg { width: 14px; height: 14px; fill: currentColor; }
.drawer-kinds { display: flex; align-items: center; gap: 8px; margin: 0 0 8px; font-weight: 600; }
.drawer-kinds .kind { width: 26px; height: 26px; border-radius: 8px; }
.drawer-kinds .kind svg { width: 18px; height: 18px; }
.tl-row .rl .s { font-size: 12px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tl-row .rt { position: relative; flex: none; }

.bar { position: absolute; top: 8px; height: calc(var(--row-h) - 16px); border-radius: 9px; display: flex; align-items: center; gap: 6px; padding: 0 10px;
  cursor: pointer; white-space: nowrap; font-weight: 600; font-size: 13px; min-width: 8px; border: 0; text-align: left;
  box-shadow: inset 0 0 0 1.5px rgba(27,28,29,.08); transition: transform .12s, box-shadow .12s; }
.bar:hover, .bar:focus-visible { transform: translateY(-1px); box-shadow: 0 4px 14px rgba(8,64,8,.18), inset 0 0 0 1.5px rgba(27,28,29,.15); outline: none; }
.bar .bl { position: sticky; left: calc(var(--label-w) + 10px); display: flex; align-items: center; gap: 6px; min-width: 0; max-width: 100%; }
.bar .bt { overflow: hidden; text-overflow: ellipsis; }
.bar .bd { font-weight: 500; opacity: .75; font-size: 12px; }
.bar.is-past { opacity: .42; }
.bar.is-current { box-shadow: inset 0 0 0 2px var(--ink); }
.bar-out { position: absolute; top: 0; height: var(--row-h); display: flex; align-items: center; gap: 6px; font-weight: 600; font-size: 13px; white-space: nowrap; pointer-events: none; }
.bar-out .bd { font-weight: 500; color: var(--muted); font-size: 12px; }
.bar-out.is-past { opacity: .5; }

.empty { margin: 16px 0 0; padding: 40px; text-align: center; border: 1.5px dashed var(--line-strong); border-radius: 16px; color: var(--muted); }
.empty h3 { margin: 0 0 6px; font: 700 24px/1.1 var(--display); text-transform: uppercase; color: var(--ink); }

/* ---------- undated ---------- */
.undated { padding: 0 28px 40px; }
.undated h2 { margin: 8px 0 4px; font: 700 22px/1 var(--display); text-transform: uppercase; }
.undated .muted { margin: 0 0 12px; }
.undated-list { display: flex; flex-wrap: wrap; gap: 8px; }
.undated-item { display: inline-flex; align-items: center; gap: 8px; padding: 8px 12px; border-radius: 10px; background: var(--surface); cursor: pointer; border: 0; font-weight: 500; }
.undated-item .dot { width: 10px; height: 10px; border-radius: 3px; }

/* ---------- drawer ---------- */
.scrim { position: fixed; inset: 0; background: rgba(27,28,29,.28); z-index: 20; }
.drawer { position: fixed; top: 0; right: 0; bottom: 0; width: min(440px, 100vw); background: #fff; z-index: 21; padding: 28px 28px 32px; overflow-y: auto;
  transform: translateX(100%); transition: transform .22s ease, visibility 0s .22s; visibility: hidden; }
.drawer.is-open { transform: none; visibility: visible; transition: transform .22s ease; box-shadow: -12px 0 40px rgba(0,0,0,.12); }
.drawer-close { position: absolute; top: 14px; right: 16px; width: 36px; height: 36px; border-radius: 10px; border: 0; background: var(--surface); font-size: 22px; cursor: pointer; }
.drawer-close:hover { background: var(--lime-mid); }
.drawer h2 { margin: 16px 0 6px; font: 700 34px/1.02 var(--display); text-transform: uppercase; }
.drawer .period { font-size: 16px; font-weight: 600; margin: 0 0 4px; }
.drawer .dur { color: var(--muted); margin: 0 0 18px; }
.drawer h4 { margin: 20px 0 8px; font: 600 12px/1 var(--display); text-transform: uppercase; letter-spacing: .06em; color: var(--muted); }
.drawer .ch-list { display: flex; flex-wrap: wrap; gap: 6px; }
.drawer .ch-list .tag { font-size: 14px; }
.drawer .meta { display: grid; grid-template-columns: auto 1fr; gap: 6px 14px; margin: 0; }
.drawer .meta dt { color: var(--muted); }
.drawer .meta dd { margin: 0; font-weight: 500; }
.drawer .actions { margin-top: 26px; }
.drawer .actions a { text-decoration: none; }
.progress { height: 8px; border-radius: 99px; background: var(--surface); overflow: hidden; margin-top: 8px; }
.progress span { display: block; height: 100%; background: var(--lime); }

/* ---------- home hub ---------- */
a.logo { display: inline-block; }
.hub-hero { position: relative; overflow: hidden; margin: 18px 28px 0; border-radius: 28px; min-height: 340px; display: flex; align-items: flex-end;
  background: linear-gradient(120deg, #30C482 0%, #3DE75E 28%, #8EF13E 58%, #D9F51F 100%); }
.hub-shape { position: absolute; border-radius: 48px; }
.hub-shape-pink { right: -6%; top: -30%; width: 34%; height: 170%; background: var(--pink); transform: rotate(14deg); }
.hub-shape-ink { right: 25%; bottom: -70px; width: 180px; height: 180px; border-radius: 50%; background: var(--green); opacity: .9; }
.hub-hero-in { position: relative; padding: 34px 40px 38px; max-width: 760px; }
.hub-hero h1 { margin: 10px 0 22px; font: 700 clamp(56px, 8vw, 116px)/.88 var(--display); text-transform: uppercase; color: var(--green); letter-spacing: -.01em; }
.hub-hello .tag { font-size: 16px; }
.hub-lead { margin: 0; max-width: 520px; font-size: 17px; font-weight: 500; color: var(--green); }
.hub-main { padding: 22px 28px 48px; }
.hub-main .banner { margin: 0 0 16px; }
.hub-groups { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 30px 16px; }
.hub-group { grid-column: span min(var(--n, 1), 4); min-width: 0; }
.hub-group-title { display: flex; align-items: center; gap: 12px; margin: 0 0 12px; font: 700 15px/1 var(--display); text-transform: uppercase; letter-spacing: .08em; color: var(--green); }
.hub-group-title::before { content: ""; width: 8px; height: 8px; border-radius: 50%; background: var(--pink); flex: none; }
.hub-group-title::after { content: ""; flex: 1; height: 1.5px; background: var(--line); }
.hub-group-admin { grid-column: 1 / -1; }
.hub-tiles { display: grid; grid-template-columns: repeat(var(--c, var(--n, 3)), minmax(0, 1fr)); gap: 16px; } /* --c: at most 4 tiles in a row */
.hub-tile { position: relative; display: flex; flex-direction: column; gap: 8px; min-height: 184px; padding: 22px 22px 20px; border-radius: 22px; text-decoration: none; color: var(--ink);
  background: var(--surface); transition: transform .15s, box-shadow .15s; overflow: hidden; }
.hub-tile .tile-ico { width: 46px; height: 46px; border-radius: 14px; display: grid; place-items: center; background: rgba(255,255,255,.6); margin-bottom: 6px; }
.hub-tile .tile-ico svg { width: 26px; height: 26px; }
.hub-tile .tile-title { font: 700 26px/1 var(--display); text-transform: uppercase; letter-spacing: .005em; }
.hub-tile .tile-desc { font-size: 14px; opacity: .8; max-width: 320px; }
.hub-tile .tile-go, .hub-tile .tile-state { margin-top: auto; font: 700 14px/1 var(--display); text-transform: uppercase; letter-spacing: .04em; display: inline-flex; align-items: center; gap: 6px; }
.hub-tile.is-open:hover, .hub-tile.is-open:focus-visible { transform: translateY(-3px) rotate(-.4deg); box-shadow: 0 14px 34px rgba(8,64,8,.2); outline: none; }
.hub-tile.is-open { background: var(--lime); color: var(--green); }
.hub-tile.is-open.tile-users { background: var(--ink); color: var(--lime); }
.hub-tile.is-open.is-legacy { background: var(--lime-mid); } /* being replaced: pale green */
.hub-tile.is-open.tile-users .tile-ico { background: rgba(167,252,38,.14); }
.hub-tile.is-open::after { content: ""; position: absolute; right: -40px; bottom: -40px; width: 140px; height: 140px; border-radius: 50%; background: rgba(255,255,255,.22); }
.hub-tile.is-open.tile-users::after { background: rgba(255,77,144,.35); }
.hub-tile.is-soon { background: #E4E5E1; color: #8d8f8a; cursor: default; }
.hub-tile.is-soon .tile-ico { background: rgba(255,255,255,.55); }
.hub-tile.is-soon .tile-state { align-self: flex-start; padding: 7px 12px; border-radius: 99px; background: #9a9c97; color: #fff; font-size: 12px; letter-spacing: .08em; }
.hub-tile.is-locked { background: var(--surface); color: #8d8f8a; cursor: not-allowed; }
.hub-tile.is-locked .tile-state { color: #8a0f3d; }
/* «Пользователи» — узкая полоса под блоками */
.hub-group-admin .hub-tiles { grid-template-columns: 1fr; }
.hub-group-admin .hub-tile { min-height: 0; flex-direction: row; align-items: center; gap: 16px; padding: 14px 22px 14px 14px; border-radius: 18px; }
.hub-group-admin .tile-ico { margin: 0; width: 40px; height: 40px; border-radius: 12px; }
.hub-group-admin .tile-title { font-size: 20px; }
.hub-group-admin .tile-desc { opacity: .6; }
.hub-group-admin .tile-go, .hub-group-admin .tile-state { margin: 0 0 0 auto; }
.hub-group-admin .hub-tile.is-open::after { right: -50px; bottom: -120px; width: 170px; height: 170px; }
.hub-group-admin .hub-tile.is-open:hover { transform: translateY(-2px); }
@media (max-width: 1180px) {
  .hub-groups { grid-template-columns: 1fr; }
  .hub-group { grid-column: auto; }
  .hub-tiles { grid-template-columns: repeat(var(--m, 2), minmax(0, 1fr)); }
}

/* ---------- users page ---------- */
.crumbs { display: flex; align-items: center; gap: 8px; margin-left: 12px; font-weight: 600; }
.crumbs a { color: var(--muted); text-decoration: none; } .crumbs a:hover { color: var(--green); }
.crumbs span { color: var(--line-strong); }
.page { max-width: 1180px; margin: 0 auto; padding: 22px 28px 48px; }
.page-title { margin: 0; font: 700 44px/1 var(--display); text-transform: uppercase; }
.page-sub { margin: 6px 0 18px; }
.users-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; align-items: start; }
.card { background: #fff; border: 1px solid var(--line); border-radius: 18px; padding: 18px 20px; }
.card h2 { margin: 0 0 10px; font: 700 20px/1 var(--display); text-transform: uppercase; }
.card .invite-box { margin: 0; border: 0; padding: 0; }
.card-wide { margin-top: 16px; }
.acc-pick { display: grid; gap: 6px; }
.acc-check { display: inline-flex; align-items: center; gap: 6px; padding: 5px 10px; border: 1.5px solid var(--line-strong); border-radius: 99px; background: #fff; font-size: 13px; font-weight: 500; cursor: pointer; }
.acc-check input { accent-color: var(--green); }
.acc-check.is-locked { opacity: .5; cursor: not-allowed; }
.users-list-page li { flex-wrap: wrap; align-items: center; }
.users-list-page .who { flex: 0 0 220px; }
.users-list-page .acc { flex: 1; display: flex; flex-wrap: wrap; gap: 5px; min-width: 260px; }
.acc-chip { border: 1.5px solid var(--line-strong); background: #fff; color: var(--muted); border-radius: 99px; padding: 4px 10px; font: 500 12px/1.2 var(--text); cursor: pointer; }
.acc-chip.is-on { background: var(--lime); border-color: var(--lime); color: var(--green); font-weight: 600; }
.acc-chip:disabled { cursor: not-allowed; opacity: .55; }
.acc-chip:not(:disabled):hover { border-color: var(--green); }
.acc-all { font-size: 13px; }
/* «Загрузка данных» — a right, not a section: dashed until granted, separated from the section chips */
.acc-chip.acc-upload { border-style: dashed; margin-left: 6px; }
.acc-chip.acc-upload.is-on { border-style: solid; background: var(--green); border-color: var(--green); color: #fff; }
.acc-check.acc-upload { border-style: dashed; }

/* ---------- section tabs next to the logo ---------- */
.sections { display: flex; align-items: center; gap: 4px; margin-left: 8px; }
.section-tab { position: relative; display: inline-flex; align-items: baseline; gap: 5px; padding: 8px 12px 7px; border-radius: 10px;
  font: 700 16px/1 var(--display); text-transform: uppercase; letter-spacing: .02em; color: var(--ink); text-decoration: none; white-space: nowrap; }
.section-tab.is-active { background: var(--lime); color: var(--green); }
.section-tab.is-soon { color: #b3b5b0; cursor: default; user-select: none; }
.section-tab.is-soon small { font: 600 9px/1 var(--text); text-transform: lowercase; letter-spacing: 0; color: #b3b5b0; border: 1px solid var(--line-strong); border-radius: 99px; padding: 2px 5px; transform: translateY(-1px); }

/* ---------- version chip (admins) ---------- */
.version-chip { font: 600 11px/1 ui-monospace, Menlo, monospace; padding: 4px 6px; border-radius: 6px; background: var(--surface); color: var(--muted); margin-right: 6px; cursor: help; }
.version-chip.is-bad { background: var(--pink-soft); color: #8a0f3d; }

/* ---------- filters popover ---------- */
.filter-wrap { position: relative; }
.btn-filters { background: var(--surface); }
.btn-filters.is-active { background: var(--ink); color: var(--lime); }
.filters-count { display: inline-grid; place-items: center; min-width: 20px; height: 20px; padding: 0 6px; border-radius: 99px; background: var(--pink); color: #fff; font-size: 12px; font-weight: 700; }
.filter-pop { position: absolute; top: calc(100% + 10px); left: 0; z-index: 30; width: min(620px, calc(100vw - 56px)); max-height: min(70vh, 640px); overflow-y: auto;
  background: #fff; border-radius: 18px; padding: 18px 20px 20px; box-shadow: 0 18px 48px rgba(8,64,8,.18), 0 0 0 1px var(--line); }
.fp-scrim { display: none; }
.fp-head { display: flex; align-items: center; gap: 8px; margin-bottom: 6px; }
.fp-head h3 { margin: 0 auto 0 0; font: 700 22px/1 var(--display); text-transform: uppercase; }
.fp-close { position: static; }
.fp-section { display: grid; gap: 8px; padding: 12px 0; border-top: 1px solid var(--line); }
.fp-section:first-of-type { border-top: 0; }
.fp-section .segmented { justify-self: start; }
body.is-calendar .fp-section.only-timeline { display: none; }
.space-chip { display: inline-flex; align-items: center; gap: 2px; }
.space-chip .gl-link { margin: 0 6px 0 2px; font-size: 13px; }

/* ---------- view switch ---------- */
.segmented.seg-view button.is-active { background: var(--lime); color: var(--green); }
body.is-calendar .only-timeline { display: none; }

/* ---------- CRM block (timeline) ---------- */
.gl-link { margin-left: auto; font-size: 12px; font-weight: 600; color: var(--muted); text-decoration: none; }
.gl-link:hover { color: var(--green); text-decoration: underline; }
.tl-row .rl.rl-static { cursor: default; }
.crm-ico { display: inline-grid; place-items: center; width: 20px; height: 20px; border-radius: 6px; flex: none; }
.crm-ico svg { width: 13px; height: 13px; fill: currentColor; }
.crm-mark { position: absolute; top: 11px; height: calc(var(--row-h) - 22px); min-width: 18px; border: 0; border-radius: 99px; padding: 0 4px;
  font: 700 12px/1 var(--text); cursor: pointer; display: grid; place-items: center; box-shadow: 0 0 0 2px #fff; z-index: 1; }
.crm-mark:hover, .crm-mark:focus-visible { transform: scale(1.12); outline: none; z-index: 2; box-shadow: 0 0 0 2px #fff, 0 4px 12px rgba(8,64,8,.25); }
.crm-mark.is-past { opacity: .4; }

/* ---------- calendar ---------- */
.cal-scroll { position: relative; overflow-y: auto; max-height: calc(100vh - 250px); min-height: 320px; border: 1px solid var(--line); border-radius: 16px; background: #fff; outline: none; }
.cal-wd { position: sticky; top: 0; z-index: 5; display: grid; grid-template-columns: repeat(7, 1fr); background: #fff; border-bottom: 1.5px solid var(--ink); }
.cal-wd span { padding: 10px 10px 8px; font: 600 12px/1 var(--display); text-transform: uppercase; letter-spacing: .06em; color: var(--muted); }
.cal-wd span.we { color: #a6a8a2; }
.cal-month { position: relative; }
.cal-title { position: sticky; top: 31px; z-index: 4; margin: 0; padding: 14px 14px 8px; background: rgba(255,255,255,.94); backdrop-filter: blur(4px);
  font: 700 24px/1 var(--display); text-transform: uppercase; border-bottom: 1px solid var(--line); }
.cal-title span { color: var(--muted); }
.cal-week { position: relative; display: grid; grid-template-columns: repeat(7, 1fr); border-bottom: 1px solid var(--line); }
.cal-day { position: relative; border-right: 1px solid var(--line); min-width: 0; }
.cal-day:last-child { border-right: 0; }
.cal-day.is-we { background: var(--weekend); }
.cal-day.is-out { background: repeating-linear-gradient(135deg, var(--surface) 0 6px, #fff 6px 12px); }
.cal-day.is-past .cal-num { color: #a6a8a2; }
.cal-num { position: absolute; top: 6px; left: 6px; min-width: 24px; height: 22px; padding: 0 6px; border: 0; border-radius: 99px; background: transparent;
  font: 600 13px/22px var(--text); color: var(--ink); cursor: pointer; text-align: center; }
.cal-num:hover { background: var(--lime-mid); }
.cal-day.is-today .cal-num { background: var(--pink); color: #fff; }
.cal-bar { position: absolute; height: 20px; border: 0; border-radius: 6px; padding: 0 7px; display: flex; align-items: center; cursor: pointer; z-index: 1;
  font: 600 12px/1 var(--text); text-align: left; white-space: nowrap; overflow: hidden; box-shadow: inset 0 0 0 1px rgba(27,28,29,.08); }
.cal-bar span { overflow: hidden; text-overflow: ellipsis; min-width: 0; }
.cal-bar.cont-l { border-top-left-radius: 0; border-bottom-left-radius: 0; }
.cal-bar.cont-r { border-top-right-radius: 0; border-bottom-right-radius: 0; }
.cal-bar.is-past { opacity: .45; }
.cal-bar:hover, .cal-bar:focus-visible { outline: none; box-shadow: 0 3px 10px rgba(8,64,8,.2), inset 0 0 0 1px rgba(27,28,29,.15); z-index: 2; }
.cal-more { position: absolute; left: 6px; border: 0; background: none; padding: 1px 4px; border-radius: 4px; font: 600 11px/1.3 var(--text); color: var(--muted); cursor: pointer; z-index: 1; }
.cal-more:hover { background: var(--surface); color: var(--ink); }
.cal-crm { position: absolute; left: 5px; right: 5px; bottom: 6px; display: flex; gap: 4px; flex-wrap: wrap; z-index: 1; }
.crm-chip { display: inline-flex; align-items: center; gap: 3px; height: 22px; padding: 0 7px 0 5px; border: 0; border-radius: 99px; cursor: pointer; font: 700 12px/1 var(--text); }
.crm-chip svg { width: 13px; height: 13px; fill: currentColor; }
.crm-chip:hover, .crm-chip:focus-visible { outline: none; transform: translateY(-1px); box-shadow: 0 3px 10px rgba(8,64,8,.2); }
.cal-day.is-past .crm-chip { opacity: .5; }

/* ---------- drawer lists ---------- */
.crm-list, .day-list { list-style: none; margin: 8px 0 0; padding: 0; border-top: 1px solid var(--line); }
.crm-list > li { display: flex; align-items: center; gap: 10px; padding: 10px 0; border-bottom: 1px solid var(--line); }
.crm-list > li > a { flex: none; width: 30px; height: 30px; display: grid; place-items: center; border-radius: 8px; background: var(--surface); text-decoration: none; font-weight: 700; }
.crm-list > li > a:hover { background: var(--lime-mid); }
.cl-t { flex: 1; min-width: 0; font-weight: 500; }
.cl-t small { display: block; color: var(--muted); font-size: 12px; font-weight: 400; margin-top: 2px; }
.day-list li { border-bottom: 1px solid var(--line); }
.day-item { width: 100%; display: flex; align-items: center; gap: 10px; padding: 10px 4px; border: 0; background: none; cursor: pointer; text-align: left; border-radius: 8px; }
.day-item:hover { background: var(--lime-soft); }
.day-item .dot { width: 12px; height: 12px; border-radius: 4px; flex: none; }

@media (max-width: 900px) {
  .cal-scroll { max-height: none; }
  .cal-wd span { padding: 8px 4px; text-align: center; }
  .cal-num { left: 2px; top: 4px; min-width: 20px; padding: 0 3px; font-size: 12px; }
  .cal-bar { font-size: 10px; padding: 0 3px; }
  .crm-chip { padding: 0 4px; gap: 1px; font-size: 10px; }
  .crm-chip svg { width: 10px; height: 10px; }
}

/* ---------- descriptions (Markdown from Kaiten) ---------- */
.md { font-size: 14px; line-height: 1.5; overflow-wrap: anywhere; }
.md > :first-child { margin-top: 0; }
.md p { margin: 0 0 10px; }
.md h5 { margin: 16px 0 6px; font-family: var(--display); text-transform: uppercase; letter-spacing: .02em; }
.md h5.md-h1 { font-size: 18px; } .md h5.md-h2 { font-size: 16px; } .md h5.md-h3 { font-size: 14px; }
.md ul, .md ol { margin: 0 0 10px; padding-left: 20px; }
.md li { margin: 2px 0; }
.md li.md-task { list-style: none; margin-left: -16px; } .md li.md-task.done { color: var(--muted); }
.md a { color: var(--green); font-weight: 600; text-decoration: underline; text-decoration-color: var(--lime); text-underline-offset: 2px; }
.md code { background: var(--surface); border-radius: 4px; padding: 1px 4px; font-size: 13px; }
.md pre { background: var(--surface); border-radius: 8px; padding: 10px; overflow-x: auto; }
.md blockquote { margin: 0 0 10px; padding: 4px 12px; border-left: 3px solid var(--lime); color: var(--muted); }
.md hr { border: 0; border-top: 1px solid var(--line); margin: 12px 0; }
.md img { display: block; max-width: 100%; max-height: 320px; border-radius: 8px; margin: 6px 0; }
.md .md-img-broken { display: inline-block; margin: 4px 0; }
.crm-list > li { flex-wrap: wrap; }
.crm-list > li.has-desc .cl-t { cursor: pointer; }
.crm-list > li.has-desc .cl-t small::after { content: " · описание ▾"; color: var(--green); font-weight: 600; }
.crm-list > li.has-desc.is-open .cl-t small::after { content: " · свернуть ▴"; }
.cl-desc { flex-basis: 100%; margin: 6px 0 2px 30px; padding: 10px 12px; background: var(--lime-soft); border-radius: 10px; }

/* ---------- invite link ---------- */
.invite-box { margin: 18px 0 8px; padding: 14px 16px; border: 1.5px dashed var(--line-strong); border-radius: 14px; }
.invite-box h4 { margin-top: 0; }
.inv-link { display: flex; gap: 6px; }
.inv-link input { flex: 1; min-width: 0; border: 1.5px solid var(--line-strong); border-radius: 10px; padding: 9px 10px; font: 500 13px/1 ui-monospace, Menlo, monospace; background: var(--lime-soft); }
.inv-meta { margin: 8px 0; font-size: 13px; }
.inv-form { margin-top: 10px; }
.inv-field { display: grid; gap: 4px; font-weight: 600; font-size: 12px; flex: 1; min-width: 140px; }
.inv-field input { border: 1.5px solid var(--line-strong); border-radius: 10px; padding: 9px 10px; background: #fff; font-weight: 400; font-size: 14px; }
.inv-note { font-size: 12px; flex: 1; }
.login-card small { font-weight: 400; }

/* ---------- users admin ---------- */
.users-form { display: grid; gap: 10px; padding: 16px; border-radius: 14px; background: var(--lime-soft); margin: 8px 0 6px; }
.users-form input[type=text], .users-form input[type=password] { width: 100%; border: 1.5px solid var(--line-strong); border-radius: 10px; padding: 10px 12px; background: #fff; }
.users-form input:focus { outline: none; border-color: var(--green); box-shadow: 0 0 0 3px var(--lime-mid); }
.users-form .row { display: flex; align-items: center; justify-content: space-between; gap: 10px; flex-wrap: wrap; }
.users-form label.check { display: inline-flex; align-items: center; gap: 8px; font-weight: 500; cursor: pointer; }
.users-form label.check input { width: 18px; height: 18px; accent-color: var(--green); }
.users-msg { margin: 10px 0 0; padding: 10px 12px; border-radius: 10px; font-weight: 500; }
.users-msg.is-error { background: var(--pink-soft); color: #8a0f3d; }
.users-msg.is-ok { background: var(--ink); color: #fff; }
.users-msg code { display: inline-block; margin-top: 6px; padding: 4px 8px; border-radius: 6px; background: var(--lime); color: var(--green); font: 700 16px/1.2 ui-monospace, Menlo, monospace; user-select: all; }
.users-msg .btn { margin-left: 8px; padding: 4px 10px; font-size: 12px; }
.users-list { list-style: none; margin: 0; padding: 0; border-top: 1px solid var(--line); }
.users-list li { display: flex; align-items: center; gap: 10px; padding: 12px 0; border-bottom: 1px solid var(--line); }
.users-list .who { flex: 1; min-width: 0; }
.users-list .who b { display: block; font-weight: 600; overflow: hidden; text-overflow: ellipsis; }
.users-list .who span { font-size: 12px; color: var(--muted); }
.users-list .badge { font: 700 11px/1 var(--display); text-transform: uppercase; letter-spacing: .04em; padding: 4px 6px 3px; border-radius: 5px; background: var(--ink); color: var(--lime); margin-left: 6px; vertical-align: 2px; }
.users-list .badge.me { background: var(--lime); color: var(--green); }
.users-list .badge.badge-locked { background: #c0392b; color: #fff; text-transform: none; }
.users-list .act { display: flex; gap: 4px; flex: none; }
.users-list .act .btn { padding: 6px 10px; font-size: 12px; }
.btn-danger { background: transparent; color: #c2185b; }
.btn-danger:hover { background: var(--pink-soft); }
.btn-danger.is-confirm { background: var(--pink); color: #fff; }

/* ---------- login ---------- */
.login-page { min-height: 100vh; display: grid; grid-template-columns: 1.1fr 1fr; background: #fff; }
.login-hero { position: relative; overflow: hidden; padding: 40px 48px; display: flex; flex-direction: column; justify-content: space-between;
  background: linear-gradient(135deg, #30C482 0%, #3DE75E 30%, #8EF13E 60%, #D9F51F 100%); }
.login-shape { position: absolute; right: -14%; top: -10%; width: 46%; height: 130%; background: var(--pink); transform: rotate(11deg); border-radius: 40px; }
.logo-big { height: 44px; position: relative; align-self: flex-start; }
.login-hero h1 { position: relative; margin: 0; font: 700 clamp(48px, 7.6vw, 150px)/.88 var(--display); text-transform: uppercase; color: var(--green); letter-spacing: -.01em; }
.login-sub { position: relative; margin: 18px 0 0; }
.login-sub .tag { font-size: 18px; }
.login-card { align-self: center; justify-self: center; width: min(380px, calc(100% - 32px)); display: grid; gap: 16px; padding: 24px 0; }
.login-card h2 { margin: 0 0 4px; font: 700 40px/1 var(--display); text-transform: uppercase; }
.login-card label { display: grid; gap: 6px; font-weight: 600; font-size: 13px; }
.login-card input { border: 1.5px solid var(--line-strong); border-radius: 12px; padding: 12px 14px; font-size: 16px; font-weight: 400; }
.login-card input:focus { outline: none; border-color: var(--green); box-shadow: 0 0 0 3px var(--lime-mid); }
.login-error { margin: 0; padding: 10px 12px; border-radius: 10px; background: var(--pink-soft); color: #8a0f3d; font-weight: 500; }

/* ---------- small screens ---------- */
@media (max-width: 900px) {
  .hub-hero { margin: 12px 16px 0; min-height: 280px; border-radius: 22px; }
  .hub-hero-in { padding: 24px 20px 26px; }
  .hub-shape-pink { width: 46%; right: -18%; }
  .hub-main { padding: 16px 16px 40px; }
  .hub-tiles { grid-template-columns: 1fr; }
  .hub-tile { min-height: 150px; }
  .hub-group-admin .tile-desc, .hub-group-admin .hub-tile.is-open::after { display: none; }
  .page { padding: 16px; }
  .users-grid { grid-template-columns: 1fr; }
  .users-list-page .who { flex-basis: 100%; }
  .sections { order: 3; width: 100%; margin-left: 0; overflow-x: auto; scrollbar-width: none; }
  .section-tab { font-size: 14px; padding: 7px 10px 6px; }
  .fp-scrim { display: block; position: fixed; inset: 0; z-index: 29; background: rgba(27,28,29,.28); }
  .fp-scrim[hidden] { display: none; }
  .filter-pop { position: fixed; top: auto; left: 0; right: 0; bottom: 0; width: auto; max-height: 80vh; border-radius: 18px 18px 0 0; }
  :root { --label-w: 170px; }
  .topbar, .controls, .filters, .timeline-wrap, .undated { padding-left: 16px; padding-right: 16px; }
  .banner { margin-left: 16px; margin-right: 16px; }
  .brand h1 { font-size: 22px; }
  .search { margin-left: 0; min-width: 0; width: 100%; }
  .filter-row { flex-direction: column; align-items: flex-start; gap: 6px; }
  .tl-row .rl .s { display: none; }
  .tl-scroll { max-height: none; }
  .login-page { grid-template-columns: 1fr; }
  .login-hero { min-height: 300px; padding: 24px 16px; }
  .login-sub .tag { font-size: 14px; white-space: normal; }
}

/* ---------- GMV overlay over the timeline ---------- */
.gmv-layer { position: absolute; top: 0; bottom: 0; left: 0; z-index: 4; pointer-events: none; }
.gmv-stick { position: sticky; overflow: hidden; border-radius: 12px;
  background: linear-gradient(rgba(255,255,255,0), rgba(255,255,255,.62) 18%, rgba(255,255,255,.62) 82%, rgba(255,255,255,0)); }
.gmv-svg { position: absolute; top: 0; left: 0; will-change: transform; }
.gmv-area { fill: rgba(167,252,38,.28); }
.gmv-halo { fill: none; stroke: #fff; stroke-width: 7; stroke-linejoin: round; stroke-linecap: round; opacity: .9; }
.gmv-line { fill: none; stroke: var(--green); stroke-width: 2.5; stroke-linejoin: round; stroke-linecap: round; }
.gmv-dot { fill: var(--green); stroke: #fff; stroke-width: 2; }
.gmv-hit { fill: transparent; pointer-events: all; cursor: help; }
.gmv-val { font: 600 11px var(--text); fill: var(--green); paint-order: stroke; stroke: #fff; stroke-width: 3px; stroke-linejoin: round; }
.gmv-cap { position: absolute; top: 6px; left: 8px; z-index: 1; font: 700 12px/1 var(--display); text-transform: uppercase; letter-spacing: .02em;
  background: var(--green); color: var(--lime); padding: 5px 8px 4px; border-radius: 6px; pointer-events: auto; }
.gmv-cap a { color: var(--lime); text-decoration: none; margin-left: 6px; font-family: var(--text); font-weight: 600; text-transform: none; }
.gmv-cap a:hover { text-decoration: underline; }

/* invite: access granted through the link */
.inv-acc { margin: 0 0 12px; }
.inv-acc .acc { margin-top: 6px; display: flex; flex-wrap: wrap; gap: 5px; }
/* timeline window: only ±N months around the centre are drawn on week / day scale */
.tl-win { margin-left: 8px; font: 600 11px/1.2 var(--text); text-transform: none; letter-spacing: 0; color: var(--muted); cursor: help; }
.tl-win-empty .s { color: var(--muted); }
