/* ============================================================
   ПРАК.ТЕМА — трекер задач. Светлая спокойная тема.
   Палитра бренда: молоко, лёд, коралл, синий, графит.
   ============================================================ */

:root {
  --paper: #FCFBF8;
  --side: #EFEDE6;
  --white: #FFFFFF;
  --ink: #1C1F25;
  --graph: #23262C;
  --soft: #5E6671;
  --muted: #8B929C;
  --faint: #B3B8BF;
  --hair: #E6E2D9;
  --row: #F1EEE8;
  --group: #F6F4EF;
  --pill: #F1EEE7;
  --hover: #F4F2EC;
  --blue: #2A72A3;
  --blue-bg: #EEF4F9;
  --blue-bd: #BCD3E4;
  --coral: #F97279;
  --red: #D9505A;
  --green: #2F7D57;
  --ice: #C6D8E6;
  --shadow: 0 1px 2px rgba(35, 38, 44, .07);
  --shadow-lg: 0 18px 50px rgba(35, 38, 44, .18), 0 2px 6px rgba(35, 38, 44, .06);
  --side-w: 244px;
  --card-w: 452px;
  --dock-h: 0px;
  color-scheme: light;
}

*, *::before, *::after { box-sizing: border-box; }
[hidden] { display: none !important; }
html, body { height: 100%; }
body {
  margin: 0;
  font: 500 14px/1.45 Manrope, system-ui, -apple-system, 'Segoe UI', sans-serif;
  color: var(--graph);
  background: var(--paper);
  -webkit-font-smoothing: antialiased;
  -webkit-tap-highlight-color: transparent;
}
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
button:disabled { cursor: default; }
a { color: inherit; text-decoration: none; }
svg.i { display: block; flex: none; }
:focus-visible { outline: 2px solid var(--blue); outline-offset: 2px; }
.grow { flex: 1; }
.dot { display: inline-block; flex: none; width: 7px; height: 7px; border-radius: 50%; }
.dot--lg { width: 9px; height: 9px; }
.is-late { color: var(--red); }
kbd {
  font: 700 11px/1.5 Manrope, sans-serif;
  border: 1px solid var(--hair); border-bottom-width: 2px; border-radius: 5px;
  padding: 0 6px; color: var(--muted); background: var(--white);
}

/* ── Кнопки ───────────────────────────────────────────── */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 7px;
  height: 36px; padding: 0 14px; border-radius: 10px; border: 1px solid transparent;
  font-size: 13px; font-weight: 800; white-space: nowrap;
  transition: background .15s, border-color .15s, opacity .15s;
}
.btn--dark { background: var(--graph); color: #fff; }
.btn--dark:hover { background: var(--ink); }
.btn--plain { background: var(--white); border-color: var(--hair); color: var(--graph); }
.btn--plain:hover { background: var(--hover); }
.btn--sm { height: 30px; padding: 0 11px; font-size: 12.5px; border-radius: 9px; }
.btn--wide { width: 100%; }
.btn:disabled { opacity: .5; }
.icon-btn {
  display: inline-grid; place-items: center; flex: none;
  width: 30px; height: 30px; border-radius: 8px; border: 0; background: transparent; color: var(--soft);
}
.icon-btn:hover { background: var(--hover); color: var(--graph); }
.icon-btn--soft { background: #F4F2EC; color: var(--graph); }
.icon-btn--soft:hover { background: #ECE9E1; }
.icon-btn--box { width: 34px; height: 34px; border: 1px solid var(--hair); background: var(--white); border-radius: 10px; color: var(--graph); }
.icon-btn:disabled { opacity: .35; background: transparent; }
.linkbtn {
  border: 0; background: none; padding: 0; font-size: 12.5px; font-weight: 700; color: var(--blue);
  text-decoration: underline; text-underline-offset: 3px; text-decoration-color: rgba(42, 114, 163, .35);
}
.linkbtn:hover { text-decoration-color: currentColor; }

/* ── Вход ─────────────────────────────────────────────── */
.gate { min-height: 100dvh; display: grid; place-items: center; padding: 24px 16px; background: var(--side); }
.gate__card {
  width: min(380px, 100%); background: var(--white); border-radius: 18px; padding: 22px;
  box-shadow: var(--shadow-lg); display: grid; gap: 14px;
}
.gate__brand { background: var(--ink); border-radius: 13px; padding: 14px 18px; margin-bottom: 6px; }
.gate__brand img { display: block; width: 100%; }

/* ── Поля в окнах ─────────────────────────────────────── */
.field { display: grid; gap: 6px; min-width: 0; }
.field__label { font-size: 12px; font-weight: 700; color: var(--soft); }
.field__label i { font-style: normal; font-weight: 600; color: var(--faint); margin-left: 4px; }
.field input, .field select, .field textarea, .est-own, .timepop select {
  width: 100%; min-height: 40px; padding: 8px 11px; border: 1px solid var(--hair); border-radius: 10px;
  background: var(--white); font-size: 14px; font-weight: 600;
}
.field textarea { resize: vertical; line-height: 1.5; }
.field input:focus, .field select:focus, .field textarea:focus, .est-own:focus { border-color: var(--blue-bd); outline: none; box-shadow: 0 0 0 3px rgba(42, 114, 163, .12); }
.field input:disabled { opacity: .45; }
.field-row { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.pair { display: grid; grid-template-columns: minmax(0, 1fr) 104px; gap: 6px; }
.form-error { margin: 0; min-height: 0; font-size: 13px; font-weight: 700; color: var(--red); }
.form-error:empty { display: none; }
.note { margin: 0; font-size: 13px; line-height: 1.55; color: var(--soft); }
.check { display: flex; align-items: center; gap: 9px; font-size: 13px; font-weight: 600; color: var(--soft); cursor: pointer; }
.check input { width: 16px; height: 16px; accent-color: var(--blue); margin: 0; }

/* ── Каркас ───────────────────────────────────────────── */
.app { display: grid; grid-template-columns: var(--side-w) minmax(0, 1fr); height: 100dvh; overflow: hidden; }
.app.has-card { grid-template-columns: var(--side-w) minmax(0, 1fr) var(--card-w); }

/* ── Меню ─────────────────────────────────────────────── */
.side {
  background: var(--side); border-right: 1px solid var(--hair);
  padding: 16px 12px 14px; display: flex; flex-direction: column; gap: 20px;
  min-height: 0; overflow-y: auto; overflow-x: hidden; overscroll-behavior: contain;
}
.side__brand { background: var(--ink); border-radius: 13px; padding: 12px 14px; flex: none; }
.side__brand img { display: block; width: 100%; }
.nav { display: grid; grid-template-columns: minmax(0, 1fr); gap: 2px; }
.nav__item {
  position: relative; display: flex; min-width: 0; align-items: center; gap: 10px; min-height: 34px;
  padding: 7px 10px; border-radius: 9px; font-size: 14px; font-weight: 600; color: var(--graph);
}
.nav__item:hover { background: rgba(255, 255, 255, .55); }
.nav__item.is-on { background: var(--white); box-shadow: var(--shadow); }
.nav__item b { margin-left: auto; font-size: 12px; font-weight: 700; color: var(--muted); white-space: nowrap; }
.nav__item b.is-hot { color: var(--red); }
.nav__ic { display: grid; place-items: center; width: 17px; color: var(--graph); }
.nav__ic--blue { color: var(--blue); }
.nav__ic--soft { color: var(--soft); }
.nav__name { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.nav__edit {
  position: absolute; right: 6px; top: 50%; transform: translateY(-50%);
  display: none; place-items: center; width: 24px; height: 24px; border: 0; border-radius: 6px;
  background: var(--white); color: var(--soft); box-shadow: var(--shadow);
}
.nav__item--proj:hover .nav__edit, .nav__edit:focus-visible { display: grid; }
.nav__item--proj:hover b { visibility: hidden; }
.side__sec { display: grid; gap: 2px; }
.side__head {
  display: flex; align-items: center; justify-content: space-between; margin: 0; padding: 0 4px 6px 10px;
  font-size: 11px; font-weight: 800; letter-spacing: .08em; text-transform: uppercase; color: var(--muted);
}
.side__add { display: grid; place-items: center; width: 24px; height: 24px; border: 0; border-radius: 7px; background: transparent; color: var(--soft); }
.side__add:hover { background: var(--white); color: var(--graph); }
.side__empty { margin: 0; padding: 4px 10px; font-size: 12.5px; color: var(--muted); }
.side__data { margin-top: auto; display: grid; grid-template-columns: 1fr 1fr; gap: 6px; }
.data-btn {
  display: flex; align-items: center; justify-content: center; height: 32px; border-radius: 9px;
  background: var(--white); border: 1px solid var(--hair); font-size: 12.5px; font-weight: 700; color: var(--soft);
}
.data-btn:hover { color: var(--graph); border-color: #D8D3C8; }
.side__me { display: flex; align-items: center; gap: 9px; padding: 10px 2px 0 6px; border-top: 1px solid var(--hair); font-size: 13px; font-weight: 700; }
.side__who { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.avatar { display: grid; place-items: center; flex: none; width: 26px; height: 26px; border-radius: 50%; background: var(--coral); color: #fff; font-size: 12px; font-weight: 800; }
.scrim { position: fixed; inset: 0; z-index: 44; background: rgba(28, 31, 37, .28); }
.menu-btn { display: none; }

/* ── Рабочая область ──────────────────────────────────── */
.main { min-width: 0; min-height: 0; display: flex; flex-direction: column; }
.view { flex: 1; min-height: 0; display: flex; flex-direction: column; }
.top { flex: none; display: flex; align-items: center; gap: 12px; min-height: 68px; padding: 10px 22px; }
.top__title { margin: 0; font-size: 26px; font-weight: 800; letter-spacing: -.02em; line-height: 1.15; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; flex: none; max-width: 45%; }
.top__count { font-size: 15px; font-weight: 700; color: var(--muted); margin-left: -4px; }
.search {
  margin-left: auto; display: flex; align-items: center; gap: 8px; flex: 0 1 300px; min-width: 180px; height: 36px;
  padding: 0 8px 0 12px; border-radius: 10px; background: var(--white); border: 1px solid var(--hair); color: var(--muted);
}
.search:focus-within { border-color: var(--blue-bd); box-shadow: 0 0 0 3px rgba(42, 114, 163, .12); }
.search input { flex: 1; min-width: 0; border: 0; outline: none; background: none; font-size: 13px; font-weight: 600; color: var(--graph); }
.search input::placeholder { color: var(--muted); }
.search input::-webkit-search-cancel-button { cursor: pointer; }
.search:focus-within kbd { visibility: hidden; }
.new-btn { flex: none; }

/* Загрузка дня */
.load { display: grid; gap: 6px; flex: 0 1 300px; min-width: 150px; margin-left: auto; }
.load:not([hidden]) + .search { margin-left: 12px; }
.load__l1 { display: flex; justify-content: space-between; gap: 10px; font-size: 12.5px; font-weight: 800; white-space: nowrap; }
.load__l1 span { color: var(--muted); font-weight: 700; overflow: hidden; text-overflow: ellipsis; }
.load__bar { height: 6px; border-radius: 3px; background: #E9E5DC; overflow: hidden; }
.load__bar i { display: block; height: 100%; border-radius: 3px; background: var(--blue); transition: width .3s; }
.load.is-over .load__bar i { background: var(--coral); }
.load.is-over .load__l1 span { color: var(--red); }

/* ── Фильтры-плашки ───────────────────────────────────── */
.filters {
  flex: none; display: flex; align-items: center; gap: 8px; min-height: 50px; padding: 8px 22px;
  border-bottom: 1px solid var(--hair); overflow-x: auto; scrollbar-width: none;
}
.filters::-webkit-scrollbar { display: none; }
.chip {
  flex: none; display: flex; align-items: center; height: 30px; border-radius: 99px;
  background: var(--white); border: 1px solid var(--hair); font-size: 12.5px; font-weight: 700; white-space: nowrap;
}
.chip__main { display: flex; align-items: center; gap: 6px; height: 100%; padding: 0 11px; border: 0; background: none; border-radius: 99px; font-weight: 700; }
.chip__main i { font-style: normal; color: var(--muted); font-weight: 600; }
.chip__main svg { color: var(--muted); }
.chip:hover { border-color: #D8D3C8; }
.chip.is-on { background: #EAF2F8; border-color: var(--blue-bd); color: var(--blue); }
.chip.is-on .chip__main { padding-right: 4px; }
.chip.is-on .chip__main i { color: #5C8DB0; }
.chip__x { display: grid; place-items: center; width: 24px; height: 24px; margin-right: 3px; border: 0; border-radius: 50%; background: none; color: var(--blue); }
.chip__x:hover { background: rgba(42, 114, 163, .12); }
.groupby { flex: none; display: flex; align-items: center; gap: 6px; height: 30px; padding: 0 8px; border: 0; border-radius: 8px; background: none; font-size: 12.5px; font-weight: 700; color: var(--soft); white-space: nowrap; }
.groupby:hover { background: var(--hover); color: var(--graph); }

/* ── Список ───────────────────────────────────────────── */
.list { flex: 1; min-height: 0; overflow-y: auto; overscroll-behavior: contain; padding-bottom: 40px; }
.list__wait { padding: 40px 22px; color: var(--muted); font-weight: 600; }
.quick { display: flex; align-items: center; gap: 10px; height: 46px; padding: 0 22px; border-bottom: 1px solid var(--row); }
.quick__plus { display: grid; place-items: center; width: 20px; color: var(--muted); }
.quick__input { flex: 1; min-width: 0; height: 100%; border: 0; outline: none; background: none; font-size: 14px; font-weight: 600; }
.quick__input::placeholder { color: var(--faint); }
.quick:focus-within { background: var(--white); }
.quick:focus-within .quick__plus { color: var(--blue); }
.quick__proj {
  flex: none; max-width: 180px; height: 28px; padding: 0 8px; border: 1px solid var(--hair); border-radius: 8px;
  background: var(--white); font-size: 12.5px; font-weight: 700; color: var(--soft);
}
.gh {
  position: sticky; top: 0; z-index: 2; display: flex; align-items: center; gap: 9px; width: 100%; height: 36px;
  padding: 0 22px 0 14px; border: 0; border-bottom: 1px solid var(--hair); background: var(--group);
  font-size: 13px; font-weight: 800; text-align: left;
}
.gh b { color: var(--muted); font-weight: 700; }
.gh__chev { display: grid; place-items: center; width: 14px; color: var(--muted); transition: transform .15s; }
.gh.is-collapsed .gh__chev { transform: rotate(-90deg); }
.gh__sum { margin-left: auto; font-size: 12px; font-weight: 700; color: var(--muted); }
.gh:hover { background: #F2EFE8; }

.row {
  display: grid; grid-template-columns: 20px 14px 50px minmax(0, 1fr) 112px 66px 70px; align-items: center; gap: 10px;
  min-height: 44px; padding: 0 22px; border-bottom: 1px solid var(--row); font-size: 14px; font-weight: 600;
  cursor: pointer; user-select: none;
}
.row:hover { background: #F8F6F1; }
.row.is-cursor { background: #F4F1EA; }
.row.is-open { background: var(--blue-bg); box-shadow: inset 3px 0 0 var(--blue); }
.tick {
  display: grid; place-items: center; width: 18px; height: 18px; padding: 0; border-radius: 50%;
  border: 1.6px solid #BCC3CC; background: var(--white); color: transparent; transition: background .15s, border-color .15s;
}
.tick:hover { border-color: var(--blue); color: var(--blue); }
.tick[aria-pressed="true"] { background: var(--blue); border-color: var(--blue); color: #fff; }
.row__prio { display: grid; place-items: center; }
.row__num { font-size: 12px; font-weight: 700; color: #A2A8B0; white-space: nowrap; }
.row__main { min-width: 0; display: flex; align-items: center; gap: 8px; }
.row__st { display: grid; place-items: center; }
.row__title { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.row__proj { flex: none; display: flex; align-items: center; gap: 5px; font-size: 12px; font-weight: 700; color: var(--muted); white-space: nowrap; max-width: 160px; overflow: hidden; text-overflow: ellipsis; }
.tag { flex: none; display: inline-flex; align-items: center; gap: 3px; font-size: 11.5px; font-weight: 700; color: var(--muted); }
.row__when { font-size: 12.5px; font-weight: 700; color: var(--soft); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.row__when.is-today { color: var(--blue); }
.row__when.is-past { color: #C0646B; }
.row__est { justify-self: start; font-size: 12px; font-weight: 800; color: var(--soft); background: var(--pill); border-radius: 6px; padding: 2px 7px; white-space: nowrap; }
.row__est.is-none { background: none; color: #CFD3D8; padding: 0 7px; }
.row__due { justify-self: end; font-size: 12.5px; font-weight: 700; color: var(--muted); white-space: nowrap; }
.row__due small { font-size: 11px; }
.row__due.is-late { color: var(--red); }
.row__due.is-today { color: var(--graph); }
.row__due.is-same:not(.is-late) { color: var(--muted); }
.row.is-done .row__title { color: var(--muted); text-decoration: line-through; text-decoration-color: rgba(139, 146, 156, .6); }
.row.is-done .row__when, .row.is-done .row__due { color: var(--faint); }

.empty { display: grid; justify-items: start; gap: 6px; max-width: 520px; padding: 40px 22px; }
.empty b { font-size: 16px; font-weight: 800; }
.empty p { margin: 0 0 6px; color: var(--soft); line-height: 1.55; }

/* ── Карточка ─────────────────────────────────────────── */
.card { min-width: 0; min-height: 0; display: flex; flex-direction: column; background: var(--white); border-left: 1px solid var(--hair); }
.card__head {
  flex: none; display: flex; align-items: center; gap: 7px; height: 52px; padding: 0 12px 0 22px;
  border-bottom: 1px solid var(--hair); font-size: 12.5px; font-weight: 700; color: var(--muted);
}
.card__proj { display: flex; align-items: center; gap: 5px; color: var(--soft); min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.card__nav { margin-left: auto; display: flex; gap: 4px; }
.card__body { flex: 1; min-height: 0; overflow-y: auto; overflow-x: hidden; overscroll-behavior: contain; padding: 16px 22px 28px; }
.card__title {
  display: block; width: 100%; margin: 0 0 12px; padding: 4px 6px; margin-left: -6px; width: calc(100% + 12px);
  border: 0; border-radius: 8px; resize: none; overflow: hidden; background: none;
  font-size: 21px; font-weight: 800; letter-spacing: -.01em; line-height: 1.25;
}
.card__title:hover { background: var(--hover); }
.card__title:focus { outline: none; background: var(--hover); }
.props { display: grid; grid-template-columns: 124px minmax(0, 1fr); align-items: center; row-gap: 4px; margin-bottom: 18px; font-size: 13.5px; }
.props__k { color: var(--muted); font-weight: 600; }
.props__v { display: flex; align-items: center; gap: 2px; min-width: 0; min-height: 32px; font-weight: 700; }
.props__v.is-high select { color: #C9454E; }
.sel-ic { display: grid; place-items: center; width: 16px; margin-right: 2px; }
.plain-sel, .plain-in {
  min-width: 0; height: 30px; padding: 0 8px; border: 0; border-radius: 7px; background: transparent;
  font-size: 13.5px; font-weight: 700; color: var(--graph);
}
.plain-sel { appearance: none; -webkit-appearance: none; cursor: pointer; padding-right: 10px; max-width: 100%; text-overflow: ellipsis; }
.plain-sel:hover, .plain-in:hover:not(:disabled), .plain-sel:focus, .plain-in:focus { background: var(--hover); outline: none; }
.plain-sel:focus-visible, .plain-in:focus-visible { box-shadow: 0 0 0 2px var(--blue-bd); }
.plain-sel--pill { background: var(--pill); }
.plain-in { min-width: 132px; }
.plain-in--time { min-width: 92px; width: 92px; }
.plain-in:disabled { opacity: .35; }
.plain-in::-webkit-calendar-picker-indicator { opacity: .45; cursor: pointer; }
.props__v--pair { gap: 4px; }
.props__v .est-own { min-height: 30px; width: 190px; padding: 4px 9px; font-size: 13px; }

.block { margin-bottom: 16px; }
.lbl { display: block; margin-bottom: 6px; font-size: 11px; font-weight: 800; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); }
.soft-area, .soft-in {
  display: block; width: calc(100% + 16px); margin-left: -8px; padding: 6px 8px; border: 1px solid transparent; border-radius: 9px;
  background: none; font-size: 13.5px; line-height: 1.6; color: var(--soft); resize: none; overflow: hidden;
}
.soft-area:hover, .soft-in:hover { background: #FAF9F6; }
.soft-area:focus, .soft-in:focus { outline: none; background: var(--white); border-color: var(--blue-bd); box-shadow: 0 0 0 3px rgba(42, 114, 163, .1); color: var(--graph); }
.soft-area::placeholder, .soft-in::placeholder { color: var(--faint); }
.block--goal { border-radius: 11px; background: #F4F8FB; border: 1px solid #DCE8F1; padding: 10px 12px 6px; }
.block--goal .soft-area { font-weight: 700; color: var(--graph); }
.block--goal .soft-area:hover { background: rgba(255, 255, 255, .6); }
.subbar { height: 4px; border-radius: 2px; background: #ECE8E0; margin-bottom: 8px; overflow: hidden; }
.subbar i { display: block; height: 100%; border-radius: 2px; background: var(--blue); transition: width .25s; }
.subs { display: grid; gap: 1px; }
.sub { display: flex; align-items: center; gap: 8px; min-height: 32px; margin-left: -6px; padding-left: 6px; border-radius: 8px; }
.sub:hover { background: #FAF9F6; }
.sub__tick { flex: none; width: 16px; height: 16px; margin: 0; accent-color: var(--blue); cursor: pointer; }
.sub__title { flex: 1; min-width: 0; height: 30px; border: 0; background: none; font-size: 13.5px; font-weight: 600; padding: 0 4px; border-radius: 6px; }
.sub__title:focus { outline: none; background: var(--white); box-shadow: 0 0 0 2px var(--blue-bd); }
.sub.is-done .sub__title { color: var(--muted); text-decoration: line-through; }
.sub__del { visibility: hidden; width: 26px; height: 26px; }
.sub:hover .sub__del, .sub__del:focus-visible { visibility: visible; }
.sub-new { width: 100%; height: 34px; margin-top: 4px; padding: 0 8px; border: 1px dashed #D9D4C9; border-radius: 9px; background: none; font-size: 13px; font-weight: 600; }
.sub-new:focus { outline: none; border-style: solid; border-color: var(--blue-bd); background: var(--white); }
.linkrow { display: flex; align-items: center; gap: 6px; }
.linkrow .soft-in { flex: 1; width: auto; }
.field-hint { margin: 4px 0 0; font-size: 12.5px; font-weight: 700; color: var(--red); }
.card__body .check { margin: 4px 0 14px; }
.card__meta { margin: 0; font-size: 12px; font-weight: 600; color: var(--faint); }
.card__error { flex: none; margin: 0; padding: 8px 22px; background: #FDECEE; color: #B23C45; font-size: 12.5px; font-weight: 700; }
.card__foot { flex: none; display: flex; align-items: center; gap: 8px; min-height: 60px; padding: 10px 14px 10px 22px; border-top: 1px solid var(--hair); }
.saved { display: flex; align-items: center; gap: 6px; font-size: 12.5px; font-weight: 700; color: var(--muted); white-space: nowrap; }
.saved--saved { color: var(--green); }
.saved--error { color: var(--red); }
.saved--error .linkbtn { color: var(--red); }

/* ── Всплывающее меню ─────────────────────────────────── */
.pop {
  position: fixed; z-index: 90; min-width: 230px; max-width: 340px; max-height: min(70vh, 520px); overflow: auto;
  background: var(--white); border: 1px solid var(--hair); border-radius: 12px; box-shadow: var(--shadow-lg); padding: 6px;
}
.pop--wide { max-width: 380px; }
.pop__head { padding: 8px 10px 4px; font-size: 11px; font-weight: 800; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); }
.opts { display: grid; gap: 1px; }
.opt {
  display: flex; align-items: center; gap: 9px; width: 100%; min-height: 34px; padding: 6px 10px; border: 0; border-radius: 8px;
  background: none; font-size: 13.5px; font-weight: 600; text-align: left;
}
.opt:hover, .opt:focus-visible { background: var(--hover); outline: none; }
.opt.is-on { color: var(--blue); font-weight: 800; }
.opt.is-on::after { content: ''; margin-left: auto; width: 6px; height: 6px; border-radius: 50%; background: var(--blue); }
.opt i { font-style: normal; margin-left: auto; color: var(--muted); font-size: 12px; }
.datepop { display: grid; gap: 12px; padding: 8px; width: 330px; max-width: 100%; }
.seg { display: grid; grid-template-columns: 1fr 1fr; padding: 3px; border-radius: 10px; background: var(--pill); }
.seg button { height: 30px; border: 0; border-radius: 8px; background: none; font-size: 12.5px; font-weight: 700; color: var(--soft); }
.seg button.is-on { background: var(--white); color: var(--graph); box-shadow: var(--shadow); }
.datepop__row { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.datepop__row label { display: grid; gap: 4px; font-size: 12px; font-weight: 700; color: var(--muted); }
.datepop__row input { height: 36px; padding: 0 8px; border: 1px solid var(--hair); border-radius: 9px; font-size: 13px; font-weight: 600; background: var(--white); min-width: 0; }
.datepop__presets { display: flex; flex-wrap: wrap; gap: 6px; }
.datepop__presets button { height: 28px; padding: 0 10px; border: 1px solid var(--hair); border-radius: 99px; background: var(--white); font-size: 12px; font-weight: 700; color: var(--soft); }
.datepop__presets button:hover { border-color: var(--blue-bd); color: var(--blue); }
.datepop__foot { display: flex; justify-content: space-between; }
.grouppop { min-width: 220px; }
.timepop { display: grid; gap: 10px; width: 260px; max-width: 100%; padding: 4px 6px 6px; }
.timepop .pop__head { padding-left: 0; }

/* ── Окна ─────────────────────────────────────────────── */
dialog.sheet {
  width: min(580px, calc(100vw - 32px)); max-height: calc(100dvh - 48px); padding: 0; border: 0; border-radius: 16px;
  background: var(--white); color: var(--graph); box-shadow: var(--shadow-lg);
}
dialog.sheet[open] { display: flex; flex-direction: column; animation: rise .16s ease-out; }
dialog.sheet > form, dialog.sheet > div { display: flex; flex-direction: column; min-height: 0; max-height: calc(100dvh - 48px); }
dialog.sheet::backdrop { background: rgba(28, 31, 37, .32); }
.sheet--slim { width: min(420px, calc(100vw - 32px)) !important; }
.sheet__head { flex: none; display: flex; align-items: center; justify-content: space-between; padding: 16px 16px 8px 22px; }
.sheet__head h2 { margin: 0; font-size: 19px; font-weight: 800; letter-spacing: -.01em; }
.sheet__body { flex: 1; min-height: 0; overflow-y: auto; display: grid; gap: 14px; padding: 8px 22px 16px; }
.sheet__foot { flex: none; display: flex; align-items: center; gap: 8px; padding: 12px 16px 16px 22px; border-top: 1px solid var(--hair); }
.sheet__hint { font-size: 12px; font-weight: 600; color: var(--faint); }
.report { padding: 12px 14px; border-radius: 11px; background: var(--group); font-size: 13px; line-height: 1.7; }
.report ul { margin: 6px 0 0; padding-left: 18px; }
.keys { display: grid; grid-template-columns: auto 1fr; gap: 10px 16px; margin: 0; align-items: center; }
.keys dt { display: flex; gap: 4px; }
.keys dd { margin: 0; font-size: 13.5px; font-weight: 600; color: var(--soft); }
@keyframes rise { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }

/* ── Уведомления ──────────────────────────────────────── */
.toasts { position: fixed; left: 50%; bottom: calc(20px + var(--dock-h)); transform: translateX(-50%); z-index: 100; display: grid; gap: 8px; justify-items: center; pointer-events: none; }
.toast {
  pointer-events: auto; display: flex; align-items: center; gap: 14px; max-width: min(520px, calc(100vw - 32px));
  padding: 10px 12px 10px 16px; border-radius: 12px; background: var(--graph); color: #fff;
  font-size: 13px; font-weight: 700; box-shadow: var(--shadow-lg); animation: rise .18s ease-out;
}
.toast--bad { background: #B23C45; }
.toast__act { flex: none; height: 28px; padding: 0 10px; border: 0; border-radius: 8px; background: rgba(255, 255, 255, .16); color: #fff; font-size: 12.5px; font-weight: 800; }
.toast__act:hover { background: rgba(255, 255, 255, .26); }

/* ── План дня ─────────────────────────────────────────── */
.top--plan { border-bottom: 1px solid var(--hair); }
.daynav { display: flex; align-items: center; gap: 8px; flex: none; min-width: 0; }
.daynav__day { font-size: 15px; font-weight: 800; white-space: nowrap; min-width: 0; overflow: hidden; text-overflow: ellipsis; }
.top--plan .load { margin-left: auto; }
.plan { flex: 1; min-height: 0; display: grid; grid-template-columns: 360px minmax(0, 1fr); }
.pool { min-height: 0; overflow-y: auto; overscroll-behavior: contain; display: flex; flex-direction: column; gap: 10px; padding: 18px 18px 24px 22px; border-right: 1px solid var(--hair); transition: background .15s; }
.pool.is-drop { background: #F3F7FA; box-shadow: inset 0 0 0 2px var(--blue-bd); }
.pool__head { display: flex; align-items: center; justify-content: space-between; font-size: 13px; font-weight: 800; }
.pool__head b { color: var(--muted); font-weight: 700; }
.pool__empty { margin: 0; font-size: 13px; line-height: 1.55; color: var(--soft); }
.pcard {
  position: relative; display: grid; grid-template-columns: 12px minmax(0, 1fr) auto; align-items: center; gap: 4px 10px;
  padding: 10px 12px 10px 8px; border-radius: 12px; background: var(--white); border: 1px solid var(--hair);
  cursor: grab; user-select: none; transition: box-shadow .15s, border-color .15s, opacity .15s;
}
.pcard:hover { border-color: #D8D3C8; box-shadow: var(--shadow); }
.pcard.is-open { border-color: var(--blue-bd); box-shadow: 0 0 0 2px rgba(42, 114, 163, .15); }
.pcard.is-lifted { opacity: .4; }
.pcard__grip { display: grid; place-items: center; height: 100%; color: #C2C6CC; touch-action: none; cursor: grab; }
.pcard__title { font-size: 13.5px; font-weight: 700; line-height: 1.3; }
.pcard__meta { display: flex; align-items: center; flex-wrap: wrap; gap: 0 5px; margin-top: 4px; font-size: 12px; font-weight: 700; color: var(--muted); }
.pcard__meta em { font-style: normal; }
.pcard__meta em.is-late { color: var(--red); }
.est { font-size: 12px; font-weight: 800; color: var(--soft); background: var(--pill); border-radius: 6px; padding: 2px 7px; white-space: nowrap; }
.est--none { background: none; color: var(--faint); }
.pcard__time {
  grid-column: 2 / -1; justify-self: start; display: none; align-items: center; gap: 5px; height: 28px; padding: 0 10px;
  border: 1px solid var(--hair); border-radius: 8px; background: var(--white); font-size: 12px; font-weight: 700; color: var(--blue);
}
.pcard:hover .pcard__time, .pcard:focus-within .pcard__time { display: inline-flex; }
.pool__add { display: flex; align-items: center; gap: 8px; height: 40px; padding: 0 12px; border: 1px dashed #D9D4C9; border-radius: 12px; color: var(--muted); }
.pool__add:focus-within { border-style: solid; border-color: var(--blue-bd); background: var(--white); color: var(--blue); }
.pool__add input { flex: 1; min-width: 0; border: 0; outline: none; background: none; font-size: 13px; font-weight: 600; color: var(--graph); }
.hint { display: flex; gap: 10px; align-items: flex-start; padding: 12px 14px; border: 1.5px dashed #CFC8B8; border-radius: 12px; font-size: 12.5px; font-weight: 600; line-height: 1.5; color: var(--soft); }
.hint svg { margin-top: 1px; }
.hint--touch { display: none; }

.tl { position: relative; min-height: 0; overflow-y: auto; overscroll-behavior: contain; padding: 18px 26px 32px 14px; }
.tl__grid { position: relative; margin-left: 56px; }
.hr { position: absolute; left: 0; right: 0; border-top: 1px solid #ECE8E0; }
.hr span { position: absolute; left: -58px; top: -9px; width: 46px; text-align: right; font-size: 12px; font-weight: 700; color: var(--muted); }
.hr--half { border-top: 1px dashed #F2EFE9; }
.tl__off { position: absolute; left: 0; right: 0; background: repeating-linear-gradient(0deg, transparent 0 7px, rgba(239, 237, 230, .5) 7px 8px); background-color: rgba(246, 244, 239, .55); }
.ev {
  position: absolute; left: 2px; width: calc(100% - 4px); border-radius: 10px; padding: 6px 12px; overflow: hidden;
  font-size: 13px; font-weight: 800; line-height: 1.3; cursor: grab; user-select: none; touch-action: pan-y;
}
.ev__title { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ev__meta { margin-top: 2px; font-size: 12px; font-weight: 700; opacity: .8; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ev.is-short { padding-top: 3px; padding-bottom: 3px; }
.ev.is-short .ev__meta { display: none; }
.ev--high { background: #FDE8E9; color: #A93841; box-shadow: inset 3px 0 0 var(--coral); }
.ev--normal { background: #E4EEF6; color: #1F5A82; box-shadow: inset 3px 0 0 var(--blue); }
.ev--low { background: #EEF4F9; color: #3D5A70; box-shadow: inset 3px 0 0 #9DBBD2; }
.ev.is-noest { outline: 1.5px dashed currentColor; outline-offset: -1.5px; }
.ev.is-done { opacity: .55; }
.ev.is-done .ev__title { text-decoration: line-through; }
.ev.is-open { box-shadow: inset 3px 0 0 currentColor, 0 0 0 2px currentColor; }
.ev.is-lifted { opacity: .35; }
.ev--lunch { left: 2px; background: repeating-linear-gradient(135deg, #F4F2EC 0 7px, #EFECE4 7px 14px); color: var(--muted); font-weight: 700; cursor: default; pointer-events: none; }
.ev--ghost { z-index: 5; border: 1.5px dashed var(--blue); background: rgba(42, 114, 163, .08); color: var(--blue); pointer-events: none; }
.ev__out {
  position: absolute; top: 4px; right: 4px; display: none; place-items: center; width: 24px; height: 22px; padding: 0;
  border: 0; border-radius: 6px; background: rgba(255, 255, 255, .75); color: inherit;
}
.ev:hover .ev__out, .ev__out:focus-visible { display: grid; }
.ev__rz { position: absolute; left: 0; right: 0; bottom: 0; height: 9px; cursor: ns-resize; touch-action: none; }
.ev__rz::after { content: ''; position: absolute; left: 50%; bottom: 3px; width: 28px; height: 3px; margin-left: -14px; border-radius: 2px; background: currentColor; opacity: 0; transition: opacity .15s; }
.ev:hover .ev__rz::after { opacity: .35; }
.nowline { position: absolute; left: -8px; right: 0; z-index: 4; height: 2px; background: var(--coral); pointer-events: none; }
.nowline::before { content: ''; position: absolute; left: -4px; top: -4px; width: 10px; height: 10px; border-radius: 50%; background: var(--coral); }
.nowline span { position: absolute; right: 0; top: -19px; font-size: 11.5px; font-weight: 800; color: var(--red); background: var(--paper); padding: 0 4px; border-radius: 4px; }
.drag-float {
  position: fixed; left: 0; top: 0; z-index: 120; max-width: 260px; padding: 8px 12px; border-radius: 10px;
  background: var(--graph); color: #fff; font-size: 12.5px; font-weight: 700; box-shadow: var(--shadow-lg);
  pointer-events: none; white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
body.is-dragging, body.is-dragging * { cursor: grabbing !important; }
body.is-resizing, body.is-resizing * { cursor: ns-resize !important; }

/* ── Календарь ────────────────────────────────────────── */
.cal { flex: 1; min-height: 0; display: flex; flex-direction: column; padding: 0 22px 22px; }
.cal__week { flex: none; display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); padding: 6px 0; font-size: 11px; font-weight: 800; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); }
.cal__week span { padding-left: 10px; }
.cal__grid {
  flex: 1; min-height: 0; display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); grid-template-rows: repeat(6, minmax(96px, 1fr));
  border: 1px solid var(--hair); border-radius: 14px; overflow: auto; background: var(--hair); gap: 1px;
}
.day { min-width: 0; min-height: 0; display: flex; flex-direction: column; gap: 3px; padding: 6px; background: var(--white); overflow: hidden; }
.day--weekend { background: #FDFCFA; }
.day--out { background: var(--group); }
.day--out .day__num { color: var(--faint); }
.day__num { align-self: flex-start; min-width: 26px; height: 24px; padding: 0 6px; border: 0; border-radius: 7px; background: none; font-size: 12.5px; font-weight: 800; color: var(--soft); }
.day__num:hover { background: var(--hover); color: var(--graph); }
.day--today .day__num { background: var(--coral); color: #fff; }
.day__items { display: grid; gap: 3px; min-height: 0; }
.pip {
  display: block; width: 100%; min-width: 0; padding: 3px 7px; border: 0; border-radius: 6px; text-align: left;
  background: #F4F2EC; box-shadow: inset 2px 0 0 var(--c, var(--blue)); font-size: 12px; font-weight: 700;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.pip:hover { background: #ECE9E1; }
.pip.is-done { color: var(--muted); text-decoration: line-through; }
.pip.is-open { background: var(--blue-bg); }
.pip--more { background: none; box-shadow: none; color: var(--muted); padding-left: 4px; }

/* ── Нижняя панель (телефон) ──────────────────────────── */
.dock { display: none; }

/* Карточка открыта рядом со списком — шапка компактнее */
@media (min-width: 1280px) and (max-width: 1699px) {
  .app.has-card .new-btn__text { display: none; }
  .app.has-card .new-btn { width: 36px; padding: 0; }
  .app.has-card .load { flex-basis: 220px; }
}

/* ============================================================
   Средний экран: карточка поверх списка
   ============================================================ */
@media (max-width: 1279px) {
  .app.has-card { grid-template-columns: var(--side-w) minmax(0, 1fr); }
  .card {
    position: fixed; top: 0; right: 0; bottom: 0; z-index: 40; width: min(var(--card-w), 100vw);
    border-left: 1px solid var(--hair); box-shadow: var(--shadow-lg); animation: slide .18s ease-out;
  }
  .load { flex-basis: 240px; }
  .top--plan .new-btn__text { display: none; }
  .top--plan .new-btn { width: 36px; padding: 0; }
  @keyframes slide { from { transform: translateX(24px); opacity: .6; } to { transform: none; opacity: 1; } }
}

/* ============================================================
   Планшет: меню выезжает сбоку
   ============================================================ */
@media (max-width: 999px) {
  .app, .app.has-card { grid-template-columns: minmax(0, 1fr); }
  .side {
    position: fixed; top: 0; left: 0; bottom: 0; z-index: 45; width: 272px;
    transform: translateX(-102%); transition: transform .2s ease; box-shadow: none;
  }
  .app.drawer-open .side { transform: none; box-shadow: var(--shadow-lg); }
  .nav__item--proj .nav__edit { display: grid; }
  .nav__item--proj b { display: none; }
  .menu-btn { display: inline-grid; margin-left: -6px; }
  .top { padding: 10px 16px; gap: 10px; }
  .filters, .quick, .gh { padding-left: 16px; padding-right: 16px; }
  .row { padding: 0 16px; grid-template-columns: 20px 14px 50px minmax(0, 1fr) 100px 60px 60px; }
  .plan { grid-template-columns: 300px minmax(0, 1fr); }
  .pool { padding-left: 16px; }
  .load { flex-basis: 200px; }
  .top--plan { flex-wrap: wrap; }
  .cal { padding: 0 16px 16px; }
}

/* ============================================================
   Телефон
   ============================================================ */
@media (max-width: 759px) {
  :root { --dock-h: calc(62px + env(safe-area-inset-bottom)); }
  body { font-size: 15px; }
  .app { height: 100dvh; padding-bottom: var(--dock-h); }

  .top { flex-wrap: wrap; row-gap: 10px; min-height: 0; padding: 12px 16px 10px; }
  .top__title { font-size: 23px; flex: 0 1 auto; max-width: none; }
  .top__count { flex: none; margin-left: 0; }
  .new-btn { width: 40px; height: 40px; padding: 0; border-radius: 12px; margin-left: auto; }
  .new-btn__text { display: none; }
  .search { order: 5; flex: 1 1 100%; margin-left: 0; height: 40px; }
  .search kbd { display: none; }
  .load, .top--plan .load { order: 6; flex: 1 1 100%; width: auto; margin-left: 0; }
  .load:not([hidden]) + .search { margin-left: 0; }
  .menu-btn { display: none; }
  .side { bottom: var(--dock-h); }

  .filters { padding: 8px 16px; gap: 6px; }
  .quick { padding: 0 16px; height: 50px; }
  .quick__proj { max-width: 120px; }
  .gh { padding: 0 16px 0 10px; }

  .row {
    grid-template-columns: 26px auto auto minmax(0, 1fr) auto;
    grid-template-areas: "tick main main main est" "tick num when due due";
    align-items: center; gap: 3px 8px; padding: 10px 16px; min-height: 58px;
  }
  .tick { grid-area: tick; width: 22px; height: 22px; align-self: start; margin-top: 1px; }
  .row__prio { display: none; }
  .row__main { grid-area: main; flex-wrap: wrap; row-gap: 2px; }
  .row__title { white-space: normal; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; font-size: 15px; }
  .row__est { grid-area: est; align-self: start; }
  .row__est.is-none { display: none; }
  .row__num { grid-area: num; }
  .row__when { grid-area: when; }
  .row__due { grid-area: due; justify-self: start; }
  .row__due:not(:empty)::before { content: '· срок '; color: var(--faint); font-weight: 600; }
  .row__due.is-same::before { content: '· '; }

  .card { position: fixed; inset: 0; z-index: 60; width: 100%; border: 0; box-shadow: none; animation: rise .18s ease-out; }
  .card__head { padding: 0 8px 0 16px; padding-top: env(safe-area-inset-top); height: calc(52px + env(safe-area-inset-top)); }
  .card__body { padding: 14px 16px 28px; }
  .card__foot { padding: 10px 12px calc(10px + env(safe-area-inset-bottom)) 16px; flex-wrap: wrap; }
  .card__foot .saved { flex: 1 1 100%; }
  .card__foot .grow { display: none; }
  .card__foot .btn { flex: 1; height: 42px; }
  .props { grid-template-columns: 116px minmax(0, 1fr); }
  .plain-sel, .plain-in { height: 36px; font-size: 15px; }
  .sub__del { visibility: visible; }

  .plan { display: block; overflow-y: auto; }
  .pool { border-right: 0; border-bottom: 1px solid var(--hair); padding: 14px 16px; overflow: visible; }
  .pcard { grid-template-columns: minmax(0, 1fr) auto; padding-left: 14px; cursor: default; }
  .pcard__grip { display: none; }
  .pcard__time { display: inline-flex; height: 32px; grid-column: 1 / -1; }
  .hint--mouse { display: none; }
  .hint--touch { display: inline; }
  .tl { overflow: visible; padding: 16px 12px 24px 4px; }
  .ev__out { display: grid; }
  .top--plan .daynav { order: 4; flex: 1 1 100%; }
  .top--plan .new-btn { width: 40px; }
  .daynav__day { flex: 1; text-align: center; font-size: 14px; }
  .daynav__today { display: none; }
  #plan-settings { order: 3; }

  .cal { padding: 0 8px 8px; }
  .cal__grid { grid-template-rows: repeat(6, minmax(74px, 1fr)); border-radius: 10px; }
  .day { padding: 3px; }
  .pip { padding: 2px 4px; font-size: 10.5px; }
  .cal__week span { padding-left: 4px; }

  .dock {
    position: fixed; left: 0; right: 0; bottom: 0; z-index: 50; display: grid; grid-template-columns: repeat(5, 1fr);
    height: var(--dock-h); padding-bottom: env(safe-area-inset-bottom);
    background: rgba(252, 251, 248, .96); border-top: 1px solid var(--hair); backdrop-filter: blur(10px);
  }
  .dock__btn {
    display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px;
    border: 0; background: none; font-size: 11px; font-weight: 700; color: var(--muted);
  }
  .dock__btn span { color: var(--muted); }
  .dock__btn.is-on { color: var(--graph); }
  .dock__btn.is-on span { color: var(--blue); }

  .pop {
    left: 8px !important; right: 8px; top: auto !important; bottom: calc(8px + env(safe-area-inset-bottom));
    max-width: none; max-height: 70dvh; border-radius: 16px; padding: 8px;
  }
  .datepop { width: auto; }
  .opt { min-height: 44px; font-size: 15px; }
  dialog.sheet { width: 100vw; max-width: 100vw; margin: auto 0 0; border-radius: 18px 18px 0 0; max-height: 92dvh; }
  dialog.sheet > form, dialog.sheet > div { max-height: 92dvh; }
  .sheet--slim { width: 100vw !important; }
  .sheet__foot { padding-bottom: calc(14px + env(safe-area-inset-bottom)); }
  .sheet__hint { display: none; }
  .field-row { grid-template-columns: 1fr; }
  .field input, .field select, .field textarea { font-size: 16px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
}
