/* Задачник: светлая «бумага», чёрная панель, пастельные карточки. Цвет карточки = важность задачи. */
@font-face { font-family: "Onest"; font-style: normal; font-weight: 100 900; font-display: swap;
  src: url("/static/fonts/onest-cyrillic.woff2") format("woff2");
  unicode-range: U+0301, U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116; }
@font-face { font-family: "Onest"; font-style: normal; font-weight: 100 900; font-display: swap;
  src: url("/static/fonts/onest-latin.woff2") format("woff2");
  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: #F3EEE4; --plate: #E8E1D3; --card: #FCF9F3; --line: #DBD3C3;
  --ink: #171513; --mute: #736C61;
  --pink: #F3B2D6; --sun: #F5D65A; --sky: #B9CCF4; --lilac: #CEC2F0; --mint: #BEE0B4;
  --r-xl: 28px; --r-l: 22px; --r-m: 16px;
  --font: "Onest", -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--paper); color: var(--ink); font: 400 15px/1.45 var(--font); font-feature-settings: "tnum" 1; }
h1, h2, h3, p { margin: 0; }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
a { color: inherit; }
:focus-visible { outline: 2px solid var(--ink); outline-offset: 2px; }
[hidden] { display: none !important; }

/* ---------- каркас ---------- */
.app { display: grid; grid-template-columns: 252px minmax(0, 1fr); min-height: 100vh; }
.side { position: sticky; top: 0; height: 100vh; padding: 16px 0 16px 16px; display: flex; flex-direction: column; }
.side::before { content: ""; position: absolute; inset: 16px 0 16px 16px; background: var(--ink); border-radius: var(--r-xl); z-index: -1; }
.side { z-index: 0; color: var(--paper); }
.wordmark { font-weight: 600; font-size: 26px; letter-spacing: -0.04em; padding: 22px 24px 26px; }
.nav { display: flex; flex-direction: column; gap: 2px; padding: 0 10px; }
.nav a { display: flex; align-items: center; gap: 12px; padding: 11px 14px; border-radius: 14px; text-decoration: none; color: #BDB6A9; font-weight: 500; }
.nav a:hover { color: var(--paper); }
.nav a[aria-current="page"] { background: var(--paper); color: var(--ink); }
.nav svg { width: 20px; height: 20px; flex: none; }
.nav .brief { display: none; }
.who { margin-top: auto; padding: 14px 14px 18px 24px; display: flex; align-items: center; gap: 10px; }
.who-text { min-width: 0; flex: 1; }
.who-name { font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.who-tg { color: #A79F92; font-size: 13px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.who .icon-btn { color: #BDB6A9; }
.who .icon-btn:hover { color: var(--paper); background: #2B2825; }
.main { padding: 34px 36px 60px; min-width: 0; outline: none; }

/* ---------- общие детали ---------- */
.head { display: flex; align-items: flex-end; justify-content: space-between; gap: 20px; flex-wrap: wrap; margin-bottom: 22px; }
.head h1 { font-weight: 500; font-size: clamp(30px, 3.6vw, 46px); line-height: 1.06; letter-spacing: -0.035em; max-width: 18em; text-wrap: balance; }
.bar { display: flex; align-items: center; gap: 10px 14px; flex-wrap: wrap; margin-bottom: 18px; }
.bar .grow { flex: 1; }
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 44px; padding: 0 20px; border: 0; border-radius: 999px;
  background: var(--ink); color: var(--paper); font-weight: 600; text-decoration: none; white-space: nowrap; }
.btn:hover { background: #000; }
.btn.soft { background: var(--plate); color: var(--ink); }
.btn.soft:hover { background: var(--line); }
.btn.small { min-height: 34px; padding: 0 14px; font-size: 14px; }
.btn.danger { background: transparent; color: #A3302B; padding: 0 12px; }
.btn.danger:hover { background: #F6DAD6; }
.btn[disabled] { opacity: .5; cursor: default; }
.icon-btn { display: inline-grid; place-items: center; width: 40px; height: 40px; border: 0; border-radius: 999px; background: transparent; }
.icon-btn:hover { background: var(--plate); }
.icon-btn svg { width: 20px; height: 20px; }
.step { display: inline-flex; align-items: center; gap: 2px; background: var(--plate); border-radius: 999px; padding: 2px; }
.step .label { padding: 0 8px; font-weight: 600; min-width: 9.5em; text-align: center; }
.chips { display: flex; gap: 6px; flex-wrap: wrap; }
.chip { display: inline-flex; align-items: center; gap: 7px; min-height: 36px; padding: 0 14px 0 6px; border: 0; border-radius: 999px; background: var(--plate); font-weight: 500; }
.chip.text { padding: 0 14px; }
.chip:hover { background: var(--line); }
.chip[aria-pressed="true"] { background: var(--ink); color: var(--paper); }
.chip .n { color: var(--mute); font-weight: 400; }
.chip[aria-pressed="true"] .n { color: #BDB6A9; }
.ava { display: inline-grid; place-items: center; width: 26px; height: 26px; border-radius: 50%; background: var(--card); font-size: 15px; line-height: 1; flex: none; }
.ava.big { width: 64px; height: 64px; font-size: 34px; }
.ava.mid { width: 38px; height: 38px; font-size: 21px; }
.side .ava.mid { background: #2B2825; }
.dot { width: 12px; height: 12px; border-radius: 50%; flex: none; display: inline-block; }
.legend { display: flex; gap: 16px; flex-wrap: wrap; color: var(--mute); font-size: 13px; }
.legend span { display: inline-flex; align-items: center; gap: 6px; }
.c-urgent { background: var(--pink); } .c-important { background: var(--sun); } .c-needed { background: var(--sky); } .c-low { background: var(--card); }
.dot.c-low { box-shadow: inset 0 0 0 1px var(--line); }
.k-launch { background: var(--pink); } .k-live { background: var(--sun); } .k-content { background: var(--sky); } .k-study { background: var(--lilac); } .k-other { background: var(--card); }
.dot.k-other { box-shadow: inset 0 0 0 1px var(--line); }
.empty { padding: 28px; border-radius: var(--r-l); background: var(--plate); color: var(--mute); max-width: 46em; }
.empty b { color: var(--ink); font-weight: 600; display: block; font-size: 17px; margin-bottom: 4px; }

/* ---------- задачи ---------- */
.board { display: grid; grid-template-columns: repeat(4, minmax(230px, 1fr)); gap: 12px; align-items: start; overflow-x: auto; padding-bottom: 8px; scroll-snap-type: x proximity; }
.col { background: var(--plate); border-radius: var(--r-l); padding: 12px; min-height: 180px; scroll-snap-align: start; }
.col.over { box-shadow: inset 0 0 0 2px var(--ink); }
.col-head { display: flex; align-items: center; justify-content: space-between; padding: 4px 6px 12px; font-weight: 600; }
.col-head .n { color: var(--mute); font-weight: 500; }
.col-list { display: flex; flex-direction: column; gap: 8px; }
.col-add { width: 100%; margin-top: 8px; min-height: 40px; border: 1.5px dashed var(--line); border-radius: var(--r-m); background: transparent; color: var(--mute); font-weight: 500; }
.col-add:hover { border-color: var(--ink); color: var(--ink); }
.task { display: block; width: 100%; text-align: left; border: 0; border-radius: var(--r-m); padding: 12px 14px 12px; }
.task:hover { box-shadow: inset 0 0 0 2px var(--ink); }
.task.dragging { opacity: .45; }
.task-top { display: flex; align-items: center; justify-content: space-between; gap: 8px; font-size: 12.5px; font-weight: 600; margin-bottom: 6px; }
.task-title { font-weight: 600; font-size: 15.5px; line-height: 1.3; letter-spacing: -0.01em; overflow-wrap: anywhere; }
.task-foot { display: flex; align-items: center; justify-content: space-between; gap: 6px 8px; flex-wrap: wrap; margin-top: 12px; font-size: 13px; }
.task-who { display: inline-flex; align-items: center; gap: 6px; min-width: 0; }
.task-who span:last-child { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.task .ava { background: rgba(255, 255, 255, .6); }
.due { padding: 3px 9px; border-radius: 999px; background: rgba(23, 21, 19, .09); white-space: nowrap; font-weight: 500; }
.due.late { background: var(--ink); color: var(--paper); }
.tail { font-weight: 500; opacity: .75; }
.col[data-status="done"] .task { background: var(--card); color: var(--mute); }
.col[data-status="done"] .task-title { text-decoration: line-through; text-decoration-thickness: 1px; }

/* ---------- календарь ---------- */
.gantt-wrap { background: var(--plate); border-radius: var(--r-l); padding: 14px; }
.gantt-scroll { overflow-x: auto; }
.gantt { display: grid; position: relative; --g-name: 200px; }
.g-day { text-align: center; font-size: 12px; color: var(--mute); padding: 4px 0 8px; line-height: 1.25; }
.g-day b { display: block; font-size: 14px; font-weight: 600; color: var(--ink); }
.g-day.off, .g-day.off b { color: #A39B8D; }
.g-day.now { background: var(--ink); border-radius: 12px; color: #BDB6A9; }
.g-day.now b { color: var(--paper); }
.g-shade { background: rgba(23, 21, 19, .045); border-radius: 8px; }
.g-today { border-left: 1.5px dashed var(--ink); justify-self: center; width: 0; }
.g-name { position: sticky; left: 0; z-index: 2; background: var(--plate); padding: 0 12px 0 4px; display: flex; align-items: center; gap: 8px; min-height: 46px; font-weight: 500; min-width: 0; }
.g-name span:last-child { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.g-bar { z-index: 1; border: 0; border-radius: 999px; min-height: 40px; margin: 3px 0; padding: 0 9px; justify-content: flex-start; text-align: left; font-weight: 600; font-size: 13.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; display: flex; align-items: center; gap: 6px; }
.g-bar:hover { box-shadow: inset 0 0 0 2px var(--ink); }
.g-bar.cut-l { border-top-left-radius: 8px; border-bottom-left-radius: 8px; }
.g-bar.cut-r { border-top-right-radius: 8px; border-bottom-right-radius: 8px; }

/* ---------- материалы ---------- */
.search { min-height: 40px; border: 0; border-radius: 999px; background: var(--plate); padding: 0 16px; width: 220px; }
.cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(290px, 1fr)); gap: 12px; }
.mat { background: var(--card); border-radius: var(--r-l); padding: 18px; display: flex; flex-direction: column; gap: 10px; min-width: 0; }
.mat-top { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.tag { display: inline-flex; align-items: center; min-height: 26px; padding: 0 10px; border-radius: 999px; font-size: 12.5px; font-weight: 600; }
.s-sites { background: var(--sky); } .s-access { background: var(--sun); } .s-rules { background: var(--lilac); } .s-templates { background: var(--pink); } .s-other { background: var(--plate); }
.mat h3 { font-size: 18px; font-weight: 600; letter-spacing: -0.015em; line-height: 1.25; overflow-wrap: anywhere; }
.mat-body { color: #4B463E; white-space: pre-wrap; overflow-wrap: anywhere; display: -webkit-box; -webkit-line-clamp: 5; -webkit-box-orient: vertical; overflow: hidden; }
.mat-link { align-self: flex-start; max-width: 100%; overflow: hidden; text-overflow: ellipsis; }
.kv { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; align-items: center; gap: 4px 10px; background: var(--paper); border-radius: var(--r-m); padding: 8px 8px 8px 14px; }
.kv .k { color: var(--mute); font-size: 13px; }
.kv .v { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-weight: 500; }
.kv .acts { display: flex; gap: 2px; }
.lock { color: var(--mute); font-size: 13px; display: inline-flex; align-items: center; gap: 6px; }
.lock svg { width: 15px; height: 15px; }
.mat-foot { display: flex; justify-content: space-between; align-items: center; gap: 8px; margin-top: auto; }

/* ---------- отчёты и команда ---------- */
.nums { display: grid; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); gap: 12px; margin-bottom: 14px; max-width: 760px; }
.num { border-radius: var(--r-l); padding: 18px 20px; background: var(--card); }
.num b { display: block; font-size: 48px; font-weight: 500; letter-spacing: -0.04em; line-height: 1; margin-bottom: 8px; }
.num.good { background: var(--mint); } .num.bad { background: var(--pink); }
.rows { background: var(--plate); border-radius: var(--r-l); padding: 8px; max-width: 760px; }
.row { display: grid; grid-template-columns: minmax(130px, 200px) minmax(80px, 1fr) auto; align-items: center; gap: 14px; padding: 10px 12px; }
.row + .row { border-top: 1px solid var(--line); }
.row-who { display: flex; align-items: center; gap: 10px; font-weight: 500; min-width: 0; }
.meter { height: 12px; border-radius: 999px; background: var(--card); overflow: hidden; }
.meter i { display: block; height: 100%; background: var(--ink); border-radius: 999px; }
.row-n { white-space: nowrap; color: var(--mute); font-size: 14px; }
.row-n b { color: var(--ink); font-weight: 600; }
.note { color: var(--mute); max-width: 46em; margin-top: 18px; }
.people { display: grid; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); gap: 12px; }
.person { background: var(--card); border-radius: var(--r-l); padding: 20px; display: flex; flex-direction: column; gap: 6px; }
.person.off { opacity: .55; }
.person h3 { font-size: 20px; font-weight: 600; letter-spacing: -0.02em; margin-top: 8px; }
.person .tg { color: var(--mute); text-decoration: none; }
.person .tg:hover { color: var(--ink); text-decoration: underline; }
.person .acts { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 12px; }

/* ---------- диалог ---------- */
.dlg { border: 0; border-radius: var(--r-xl); background: var(--paper); color: var(--ink); padding: 0; width: min(560px, calc(100vw - 24px)); max-height: calc(100vh - 24px); }
.dlg::backdrop { background: rgba(23, 21, 19, .45); }
.form { padding: 26px 28px 22px; display: flex; flex-direction: column; gap: 14px; }
.form h2 { font-size: 26px; font-weight: 500; letter-spacing: -0.03em; line-height: 1.1; margin-bottom: 2px; }
.field { display: flex; flex-direction: column; gap: 6px; }
.field > span, .field > legend { font-size: 13px; color: var(--mute); padding: 0; }
fieldset.field { border: 0; margin: 0; padding: 0; min-width: 0; }
.field input[type="text"], .field input[type="date"], .field input[type="url"], .field select, .field textarea {
  width: 100%; min-height: 44px; border: 1.5px solid var(--line); border-radius: 14px; background: var(--card); padding: 9px 14px; }
.field textarea { min-height: 96px; resize: vertical; }
.field input:focus, .field select:focus, .field textarea:focus { outline: none; border-color: var(--ink); }
.two { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.pick { display: flex; gap: 6px; flex-wrap: wrap; }
.pick label { position: relative; }
.pick input { position: absolute; opacity: 0; inset: 0; cursor: pointer; }
.pick span { display: inline-flex; align-items: center; min-height: 38px; padding: 0 14px; border-radius: 999px; font-weight: 600; box-shadow: inset 0 0 0 1.5px transparent; }
.pick input:checked + span { box-shadow: inset 0 0 0 2px var(--ink); }
.pick input:focus-visible + span { outline: 2px solid var(--ink); outline-offset: 2px; }
.pick.plain span { background: var(--plate); }
.emojis { display: grid; grid-template-columns: repeat(auto-fill, minmax(40px, 1fr)); gap: 4px; }
.emojis span { justify-content: center; padding: 0; width: 40px; height: 40px; font-size: 21px; background: var(--card); }
.hint { font-size: 13px; color: var(--mute); }
.form-foot { display: flex; align-items: center; gap: 8px; margin-top: 6px; flex-wrap: wrap; }
.form-foot .grow { flex: 1; }
.err { color: #A3302B; font-weight: 500; }
.view-body { white-space: pre-wrap; overflow-wrap: anywhere; }

.toast { position: fixed; left: 50%; bottom: 24px; transform: translateX(-50%); background: var(--ink); color: var(--paper); padding: 12px 20px; border-radius: 999px; font-weight: 500; max-width: calc(100vw - 32px); opacity: 0; pointer-events: none; transition: opacity .2s; z-index: 50; }
.toast.on { opacity: 1; }

/* ---------- вход ---------- */
.gate { display: grid; place-items: center; min-height: 100vh; padding: 20px; }
.gate-box { background: var(--card); border-radius: var(--r-xl); padding: 34px 36px 38px; width: min(520px, 100%); }
.gate-box .wordmark { padding: 0 0 26px; }
.gate-box h1 { font-size: 34px; font-weight: 500; letter-spacing: -0.035em; line-height: 1.08; margin-bottom: 12px; }
.gate-text { color: var(--mute); margin-bottom: 22px; max-width: 34em; }

/* ---------- телефон ---------- */
@media (max-width: 860px) {
  .app { display: block; }
  .side { position: fixed; inset: auto 0 0 0; height: auto; padding: 0 10px 10px; z-index: 20; flex-direction: row; }
  .side::before { inset: 0 10px 10px 10px; border-radius: 22px; }
  .wordmark, .who { display: none; }
  .gate-box .wordmark { display: block; }
  .nav { flex-direction: row; justify-content: space-around; width: 100%; padding: 6px; gap: 0; }
  .nav a { flex-direction: column; gap: 3px; padding: 8px 6px; font-size: 10.5px; flex: 1; text-align: center; line-height: 1.15; border-radius: 16px; }
  .nav .long { display: none; }
  .nav .brief { display: block; }
  .gantt { --g-name: 128px; }
  .g-name { font-size: 13.5px; }
  .main { padding: 22px 16px 110px; }
  .board { grid-template-columns: repeat(4, 82vw); }
  .two { grid-template-columns: 1fr; }
  .form { padding: 22px 18px 18px; }
  .search { width: 100%; }
  .toast { bottom: 96px; }
  .row { grid-template-columns: minmax(0, 1fr) auto; }
  .row .meter { grid-column: 1 / -1; grid-row: 2; }
}
@media (prefers-reduced-motion: reduce) { * { transition: none !important; scroll-behavior: auto !important; } }
