/* Порядок: стиль Yotta. Onest: заголовки 700, кнопки 600, текст 400. Всегда светлый, белый фон.
   Нефрит только точкой, коралл только «просрочено», главная кнопка одна и графитовая. */
@font-face {
  font-family: 'Onest';
  src: url('fonts/onest.woff2') format('woff2');
  font-weight: 400 700;
  font-style: normal;
  font-display: swap;
}

:root {
  color-scheme: light;
  --ink: #2B2B28;
  --mist: #E8E8E3;
  --caption: #62625C;
  --paper: #F4F4F1;
  --white: #FFFFFF;
  --jade: #00A36C;
  --amber-bg: #FCEFD9;
  --amber: #8A5300;
  --coral-bg: #FCE6E1;
  --coral: #B42318;
  --font: 'Onest', -apple-system, system-ui, sans-serif;
  --gutter-l: max(16px, env(safe-area-inset-left, 0px));
  --gutter-r: max(16px, env(safe-area-inset-right, 0px));
  --safe-b: env(safe-area-inset-bottom, 0px);
  --bar: 57px;
  --ease: cubic-bezier(0.22, 1, 0.36, 1);
  --page-slide-dur: 200ms;
  --page-fade-dur: 200ms;
  --page-slide-distance: 8px;
  --page-blur: 3px;
  --page-slide-ease: cubic-bezier(0.22, 1, 0.36, 1);
  --page-fade-ease: cubic-bezier(0.22, 1, 0.36, 1);
  --check-opacity-dur: 260ms;
  --check-rotate-dur: 320ms;
  --check-rotate-from: 40deg;
  --check-bob-dur: 300ms;
  --check-y-amount: 6px;
  --check-blur-dur: 260ms;
  --check-blur-from: 2px;
  --check-path-dur: 320ms;
  --check-path-delay: 40ms;
  --check-ease-out: cubic-bezier(0.22, 1, 0.36, 1);
  --check-ease-opacity: cubic-bezier(0.22, 1, 0.36, 1);
  --check-ease-rotate: cubic-bezier(0.22, 1, 0.36, 1);
  --check-ease-bob: cubic-bezier(0.22, 1, 0.36, 1);
  --check-ease-path: cubic-bezier(0.22, 1, 0.36, 1);
  --shake-distance: 6px;
  --shake-overshoot: 4px;
  --shake-dur-a: 80ms;
  --shake-dur-b: 60ms;
  --shake-ease: cubic-bezier(0.22, 1, 0.36, 1);
  --revert-hold: 3000ms;
  --revert-dur: 280ms;
}

*, *::before, *::after { box-sizing: border-box; }
html { background: var(--white); -webkit-text-size-adjust: 100%; scrollbar-color: var(--mist) transparent; }
body {
  margin: 0;
  background: var(--white);
  color: var(--ink);
  font: 400 16px/1.4 var(--font);
  -webkit-font-smoothing: antialiased;
  -webkit-tap-highlight-color: transparent;
  overflow-wrap: anywhere;
}
::selection { background: var(--mist); color: var(--ink); }
input, textarea, select, button { font: inherit; color: inherit; caret-color: var(--ink); }
button { cursor: pointer; touch-action: manipulation; }
a { color: inherit; touch-action: manipulation; }
h1, h2, h3, p, ul { margin: 0; padding: 0; }
ul { list-style: none; }
:focus { outline: none; }
:focus-visible { outline: 2px solid var(--ink); outline-offset: 2px; border-radius: 8px; }
[hidden] { display: none !important; }

/* ---- заголовки ---- */
.h1 { font-size: 28px; line-height: 1.15; font-weight: 700; letter-spacing: -0.02em; text-wrap: balance; }
.h2 { font-size: 18px; line-height: 1.25; font-weight: 700; letter-spacing: -0.01em; }
.h3 { font-size: 16px; line-height: 1.3; font-weight: 700; }
.caption { color: var(--caption); }
.page-head { margin-bottom: 20px; display: grid; gap: 4px; }
.sec { margin-top: 28px; }
.sec > .h2 { margin-bottom: 6px; }
.empty { color: var(--caption); padding: 10px 0; }

/* ---- каркас ---- */
main {
  max-width: 640px;
  margin: 0 auto;
  padding: 20px var(--gutter-r) calc(var(--bar) + var(--safe-b) + 32px) var(--gutter-l);
}
main:focus-visible { outline: none; }
.page-in { animation: t-page-in var(--page-slide-dur) var(--page-slide-ease); }
@keyframes t-page-in {
  from { opacity: 0; transform: translateX(var(--t-page-from-x, 0)); filter: blur(var(--page-blur)); }
  to { opacity: 1; transform: translateX(0); filter: blur(0); }
}
main[data-dir="forward"] { --t-page-from-x: var(--page-slide-distance); }
main[data-dir="back"] { --t-page-from-x: calc(var(--page-slide-distance) * -1); }

.mark { display: none; font-size: 20px; font-weight: 700; letter-spacing: -0.03em; text-decoration: none; align-items: flex-start; gap: 3px; }
.mark i { width: 7px; height: 7px; border-radius: 50%; background: var(--jade); margin-top: 8px; }

/* нижнее меню на телефоне */
.top {
  position: fixed;
  z-index: 20;
  inset: auto 0 0 0;
  display: flex;
  align-items: center;
  gap: 8px;
  background: var(--white);
  border-top: 1px solid var(--mist);
  padding: 0 var(--gutter-r) var(--safe-b) var(--gutter-l);
}
.tabs { flex: 1; min-width: 0; display: grid; grid-template-columns: repeat(3, 1fr); }
.tab {
  position: relative;
  display: grid;
  place-items: center;
  height: 56px;
  font-weight: 600;
  color: var(--caption);
  text-decoration: none;
  white-space: nowrap;
  overflow-wrap: normal;
}
.tab[aria-current="page"] { color: var(--ink); }
.tab[aria-current="page"]::after {
  content: "";
  position: absolute;
  left: 50%;
  bottom: 6px;
  width: 6px;
  height: 6px;
  margin-left: -3px;
  border-radius: 50%;
  background: var(--jade);
}
.primary {
  background: var(--ink);
  color: var(--white);
  border: 0;
  border-radius: 12px;
  font-weight: 600;
  transition: background-color 150ms ease-out, transform 150ms var(--ease);
}
.primary:active { transform: scale(0.97); }
.add { flex: none; width: 56px; height: 44px; display: grid; place-items: center; }

/* ---- кнопки ---- */
.btn {
  min-height: 44px;
  padding: 8px 14px;
  border: 0;
  border-radius: 12px;
  background: var(--paper);
  font-weight: 600;
  line-height: 1.2;
  text-align: center;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: background-color 150ms ease-out, transform 150ms var(--ease);
}
.btn:active { transform: scale(0.97); }
.btn[disabled], .primary[disabled] { opacity: 0.55; cursor: default; }
.link {
  min-height: 44px;
  padding: 0;
  border: 0;
  background: none;
  font-weight: 600;
  text-align: left;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  text-decoration: none;
}
.chev { flex: none; color: var(--caption); transition: transform 200ms var(--ease); }
@media (hover: hover) {
  .btn:hover { background: var(--mist); }
  .primary:hover { background: #3A3A36; }
  .tab:hover { color: var(--ink); }
  .link:hover, .fold-btn:hover .fold-title, .row-link:hover .row-title { text-decoration: underline; text-underline-offset: 3px; text-decoration-color: var(--caption); }
  .task .body:hover .title { text-decoration: underline; text-underline-offset: 3px; text-decoration-color: var(--caption); }
  .check:hover .ring { background: var(--paper); }
}

/* ---- задача в списке ---- */
.task {
  display: grid;
  grid-template-columns: 44px minmax(0, 1fr) auto;
  column-gap: 4px;
  align-items: start;
  border-bottom: 1px solid var(--mist);
}
.list > .task:last-child { border-bottom: 0; }
.task.no-check { grid-template-columns: minmax(0, 1fr); }
.check {
  width: 44px;
  height: 44px;
  margin-left: -9px;
  padding: 0;
  border: 0;
  background: none;
  display: grid;
  place-items: center;
}
.ring {
  width: 26px;
  height: 26px;
  border-radius: 50%;
  border: 2px solid var(--caption);
  display: grid;
  place-items: center;
  color: var(--white);
  transition: background-color 180ms ease-out, border-color 180ms ease-out, transform 150ms var(--ease);
}
.check:active .ring { transform: scale(0.9); }
.check.wait .ring { border-style: dashed; }
.body {
  display: block;
  min-height: 44px;
  padding: 10px 0;
  text-decoration: none;
  color: inherit;
}
.title { display: block; line-height: 1.35; }
.meta { display: flex; flex-wrap: wrap; align-items: center; gap: 2px 10px; margin-top: 2px; color: var(--caption); }
.big .title { font-size: 18px; line-height: 1.3; }
.big .body { padding: 11px 0 12px; }
.task .btn { margin: 6px 0 6px 6px; }
.sig { padding: 0 6px; border-radius: 6px; line-height: 1.4; }
.sig.late { background: var(--coral-bg); color: var(--coral); }
.sig.warn { background: var(--amber-bg); color: var(--amber); }
.money { color: var(--ink); font-weight: 600; font-variant-numeric: lining-nums; white-space: nowrap; }  /* без tabular-nums: он рвёт «123 000» на «1 23 000» */
.risk-why { color: var(--coral); }
.q {
  flex: none;
  width: 26px;
  height: 26px;
  border-radius: 50%;
  background: var(--mist);
  color: var(--ink);
  display: inline-grid;
  place-items: center;
  font-weight: 600;
  font-variant-numeric: lining-nums;
}

/* сделано: кольцо заливается графитом, галочка рисуется */
.task.is-done .ring { background: var(--ink); border-color: var(--ink); border-style: solid; }
.task.is-done .title { color: var(--caption); text-decoration: line-through; text-decoration-color: var(--caption); }
.task.is-leaving { overflow: hidden; transition: height 240ms var(--ease), opacity 200ms ease-out; opacity: 0; }
.t-success-check {
  display: inline-block;
  transform-origin: center;
  opacity: 0;
  will-change: transform, opacity, filter;
}
.t-success-check svg { display: block; overflow: visible; }
.t-success-check svg path { stroke-dasharray: 16; stroke-dashoffset: 16; }
.t-success-check[data-state="in"] {
  animation:
    t-check-fade   var(--check-opacity-dur) var(--check-ease-opacity) forwards,
    t-check-rotate var(--check-rotate-dur)  var(--check-ease-rotate)  forwards,
    t-check-blur   var(--check-blur-dur)    var(--check-ease-out)     forwards,
    t-check-bob    var(--check-bob-dur)     var(--check-ease-bob)     forwards;
}
.t-success-check[data-state="in"] svg path {
  animation: t-check-draw var(--check-path-dur) var(--check-ease-path) var(--check-path-delay, 0ms) forwards;
}
.t-success-check[data-state="on"] { opacity: 1; }
.t-success-check[data-state="on"] svg path { stroke-dashoffset: 0; }
@keyframes t-check-fade { from { opacity: 0; } to { opacity: 1; } }
@keyframes t-check-rotate {
  from { transform: rotate(var(--check-rotate-from)); }
  to   { transform: rotate(0deg); }
}
@keyframes t-check-blur {
  from { filter: blur(var(--check-blur-from)); }
  to   { filter: blur(0); }
}
@keyframes t-check-bob {
  from { translate: 0 var(--check-y-amount); }
  to   { translate: 0 0; }
}
@keyframes t-check-draw { to { stroke-dashoffset: 0; } }

/* ---- свёрнутые строки ---- */
.fold { border-top: 1px solid var(--mist); }
.fold-h { font: inherit; }
.fold-btn {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto 20px;
  align-items: center;
  column-gap: 10px;
  width: 100%;
  min-height: 52px;
  padding: 10px 0;
  border: 0;
  background: none;
  font-weight: 600;
  line-height: 1.3;
  text-align: left;
}
.fold-sub { grid-column: 1 / -1; grid-row: 2; color: var(--caption); font-weight: 400; margin-top: 2px; }
.fold-value { color: var(--caption); font-weight: 400; font-variant-numeric: lining-nums tabular-nums; }
.fold-value.money-total { color: var(--ink); font-weight: 700; font-size: 18px; white-space: nowrap; font-variant-numeric: lining-nums; }
[aria-expanded="true"] > .chev { transform: rotate(180deg); }
.fold-panel {
  display: grid;
  grid-template-rows: 0fr;
  visibility: hidden;
  transition: grid-template-rows 250ms var(--ease), visibility 0s linear 250ms;
}
.fold-panel[data-open] {
  grid-template-rows: 1fr;
  visibility: visible;
  transition: grid-template-rows 250ms var(--ease), visibility 0s;
}
.fold-inner { min-height: 0; overflow: hidden; margin-left: -9px; padding-left: 9px; }
.fold-group { margin: 8px 0 2px; display: flex; gap: 8px; justify-content: space-between; align-items: baseline; }

/* ---- «Сегодня» ---- */
.inbox-row {
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 52px;
  margin-bottom: 20px;
  padding: 0 12px 0 14px;
  border-radius: 12px;
  background: var(--paper);
  font-weight: 600;
  text-decoration: none;
}
.inbox-row .sig { margin-left: auto; font-variant-numeric: lining-nums tabular-nums; }
.inbox-row .chev { transform: rotate(-90deg); }
.more { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 4px 12px; padding-top: 4px; border-top: 1px solid var(--mist); }
.today-main .sec:first-child { margin-top: 0; }
.today-rest { margin-top: 20px; }
.rest-link { width: 100%; justify-content: space-between; min-height: 52px; border-top: 1px solid var(--mist); }
.rest-link .chev { transform: rotate(-90deg); }
.matrix, .rail-title { display: none; }

/* ---- «Неделя» ---- */
.day { padding: 10px 0 6px; border-top: 1px solid var(--mist); }
.day-h { display: flex; flex-wrap: wrap; align-items: baseline; gap: 2px 8px; font-weight: 700; }
.day-h .caption { font-weight: 400; }
.day-free { margin-left: auto; color: var(--caption); font-weight: 400; }
.day .task .body { padding-top: 8px; }
.day .meta .q { margin-right: -2px; }
.strip { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 4px; margin: 6px 0 12px; }
.strip div { display: grid; justify-items: center; gap: 0; padding: 6px 0; border-radius: 10px; background: var(--paper); color: var(--caption); }
.strip b { color: var(--ink); font-weight: 700; font-variant-numeric: lining-nums tabular-nums; min-height: 22px; }
.strip .later { background: none; box-shadow: inset 0 0 0 1px var(--mist); }

/* ---- «Проекты» и «Проект» ---- */
.project-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 2px 10px;
  min-height: 60px;
  padding: 10px 0;
  border-bottom: 1px solid var(--mist);
  text-decoration: none;
}
.row-title { font-weight: 600; font-size: 18px; letter-spacing: -0.01em; margin-right: auto; }
.logout-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-top: 24px; color: var(--caption); }
.logout-row .link { color: var(--ink); }
.groups { display: grid; gap: 28px; }
.group h3 { font-size: 18px; line-height: 1.25; font-weight: 700; letter-spacing: -0.01em; margin-bottom: 4px; }
.person-form { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 8px; margin-top: 24px; }
.add-person { margin-top: 24px; }

/* ---- карточка ---- */
.back { margin: -10px 0 6px -2px; color: var(--caption); }
.back .chev { transform: rotate(90deg); }
.tg-back .back { display: none; }
/* на телефоне поля идут одной колонкой, комментарии и сведения в конце */
.card-grid { display: flex; flex-direction: column; gap: 18px; }
.card-col { display: contents; }
.comments { order: 2; }
.facts { order: 3; }
.field { display: grid; gap: 4px; min-width: 0; }
.label { color: var(--caption); }
.pair { display: grid; grid-template-columns: repeat(auto-fit, minmax(136px, 1fr)); gap: 18px 12px; }
.input, .textarea, .select {
  width: 100%;
  min-height: 44px;
  padding: 10px 12px;
  border: 1px solid var(--mist);
  border-radius: 12px;
  background: var(--paper);
  transition: border-color 150ms ease-out, background-color 150ms ease-out;
}
.input:focus, .textarea:focus, .select:focus { background: var(--white); border-color: var(--caption); outline: none; }
.textarea { display: block; resize: none; line-height: 1.35; overflow: hidden; }
.select { appearance: auto; }
.input::placeholder, .textarea::placeholder { color: var(--caption); opacity: 1; }
.card-title { font: inherit; }
.title-input {
  font-size: 24px;
  line-height: 1.2;
  font-weight: 700;
  letter-spacing: -0.02em;
  padding: 6px 8px;
  margin-left: -9px;
  width: calc(100% + 18px);
  border-color: transparent;
  background: none;
}
@media (hover: hover) { .title-input:hover { background: var(--paper); } }
.sr-only { position: absolute; width: 1px; height: 1px; margin: -1px; padding: 0; overflow: hidden; clip-path: inset(50%); white-space: nowrap; border: 0; }
.chips { display: flex; flex-wrap: wrap; gap: 6px; }
.chip {
  min-height: 44px;
  padding: 8px 12px;
  border: 1px solid var(--mist);
  border-radius: 12px;
  background: var(--white);
  font-weight: 600;
  line-height: 1.2;
  transition: background-color 150ms ease-out, transform 150ms var(--ease);
}
.chip:active { transform: scale(0.97); }
.chip[aria-pressed="true"] { background: var(--mist); }
.due-row { display: grid; gap: 6px; }
.switch { display: flex; align-items: center; gap: 10px; min-height: 44px; cursor: pointer; }
.switch input { width: 22px; height: 22px; margin: 0; accent-color: var(--ink); flex: none; }
.facts { display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 4px 14px; }
.facts dt { color: var(--caption); }
.facts dd { margin: 0; }
.comment { padding: 10px 0; border-top: 1px solid var(--mist); white-space: pre-wrap; }
.comment-who { display: flex; flex-wrap: wrap; gap: 0 8px; white-space: normal; }
.comment-who b { font-weight: 600; }
.comment-form { display: grid; gap: 8px; margin-top: 8px; }
.comment-form .btn { justify-self: start; }
.actions {
  position: fixed;
  z-index: 20;
  inset: auto 0 0 0;
  display: grid;
  grid-auto-flow: column;
  grid-template-columns: minmax(0, 1fr);
  grid-auto-columns: auto;
  gap: 8px;
  padding: 6px var(--gutter-r) calc(6px + var(--safe-b)) var(--gutter-l);
  background: var(--white);
  border-top: 1px solid var(--mist);
}
.actions .primary { min-height: 44px; padding: 8px 14px; }
body[data-route="task"] .top, body[data-gate] .top { display: none; }
body[data-route="task"] main { padding-bottom: calc(var(--bar) + var(--safe-b) + 24px); }

/* ---- новая задача ---- */
.line {
  position: fixed;
  z-index: 30;
  inset: auto 0 var(--kb, 0px) 0;
  display: grid;
  gap: 6px;
  padding: 8px var(--gutter-r) calc(8px + var(--safe-b)) var(--gutter-l);
  background: var(--white);
  border-top: 1px solid var(--mist);
  box-shadow: 0 -8px 24px rgba(43, 43, 40, 0.08);
  visibility: hidden;
  opacity: 0;
  transform: translateY(8px);
  transition: opacity 180ms ease-out, transform 200ms var(--ease), visibility 0s linear 200ms;
}
.line-open .line { visibility: visible; opacity: 1; transform: translateY(0); transition: opacity 180ms ease-out, transform 200ms var(--ease), visibility 0s; }
body[data-route="task"] .line, body[data-gate] .line { display: none; }
.line-hint { color: var(--caption); }
.line-row { display: grid; grid-template-columns: minmax(0, 1fr) 44px 44px; gap: 6px; align-items: center; }
.line-field {
  position: relative;
  border: 1px solid var(--mist);
  border-radius: 12px;
  background: var(--paper);
}
.line-field:focus-within { border-color: var(--caption); background: var(--white); }
.line-field input { display: block; width: 100%; min-height: 44px; padding: 8px 12px; border: 0; background: none; outline: none; }
.line-field input::placeholder { color: var(--caption); opacity: 1; }
.key { display: none; }
.line-send { height: 44px; display: grid; place-items: center; padding: 0; }
.line-send-text { display: none; }
.line-close { width: 44px; height: 44px; display: grid; place-items: center; padding: 0; border: 0; background: none; color: var(--caption); }

/* ошибка поля: янтарь, коралл оставлен для «просрочено» */
.t-input { transition: border-color 150ms ease-out; will-change: transform; }
.t-input.is-error { transition: border-color var(--revert-dur, 280ms) ease-out; }
.t-input.is-error, .t-input.is-error .input, .t-input.is-error .select { border-color: var(--amber); }
.t-input.is-error .input, .t-input.is-error .select { background: var(--amber-bg); }
.t-input.is-shaking {
  animation: t-input-shake calc(var(--shake-dur-a) * 2 + var(--shake-dur-b) * 2) linear;
}
@keyframes t-input-shake {
  0%      { transform: translateX(0);                                 animation-timing-function: var(--shake-ease); }
  28.57%  { transform: translateX(var(--shake-distance));             animation-timing-function: var(--shake-ease); }
  57.14%  { transform: translateX(calc(var(--shake-distance) * -1)); animation-timing-function: var(--shake-ease); }
  78.57%  { transform: translateX(var(--shake-overshoot));            animation-timing-function: var(--shake-ease); }
  100%    { transform: translateX(0); }
}

/* ---- уведомление ---- */
.toast {
  position: fixed;
  z-index: 40;
  left: var(--gutter-l);
  right: var(--gutter-r);
  bottom: calc(var(--bar) + var(--safe-b) + var(--kb, 0px) + 8px);
  max-width: 480px;
  margin: 0 auto;
  min-height: 48px;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 4px 8px 4px 14px;
  border-radius: 14px;
  background: var(--ink);
  color: var(--white);
  box-shadow: 0 8px 24px rgba(43, 43, 40, 0.24);
  visibility: hidden;
  opacity: 0;
  transform: translateY(8px);
  transition: opacity 160ms ease-out, transform 200ms var(--ease), visibility 0s linear 200ms;
}
.toast[data-show] { visibility: visible; opacity: 1; transform: translateY(0); transition: opacity 160ms ease-out, transform 200ms var(--ease), visibility 0s; }
.toast-text { flex: 1; min-width: 0; padding: 8px 0; }
.toast-act {
  flex: none;
  min-height: 44px;
  padding: 0 8px;
  border: 0;
  background: none;
  color: var(--white);
  font-weight: 600;
  text-decoration: underline;
  text-underline-offset: 3px;
}
.toast-act:focus-visible { outline-color: var(--white); }
.line-open .toast { bottom: calc(var(--kb, 0px) + var(--safe-b) + 112px); }

/* ---- экраны входа и ошибок ---- */
.gate { min-height: 70vh; display: grid; align-content: center; gap: 14px; max-width: 420px; margin: 0 auto; padding: 24px 0; }
.gate .mark { display: inline-flex; margin-bottom: 8px; }
.gate-actions { display: grid; gap: 8px; justify-items: start; margin-top: 6px; min-height: 44px; }

/* ---- пока грузится: спокойные полоски без перелива ---- */
.skel { display: grid; gap: 14px; margin-top: 8px; }
.skel i { display: block; height: 44px; border-radius: 12px; background: var(--paper); }
.skel i:nth-child(2) { width: 88%; }
.skel i:nth-child(3) { width: 72%; }
.banner { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 14px; padding: 2px 4px 2px 12px; border-radius: 12px; background: var(--amber-bg); color: var(--amber); }
.banner .link { color: var(--amber); padding: 0 8px; }

/* ---- компьютер ---- */
@media (min-width: 980px) {
  main { max-width: 1264px; padding: 28px 32px 112px; }
  .h1 { font-size: 32px; }
  .top {
    position: sticky;
    top: 0;
    bottom: auto;
    height: 64px;
    border-top: 0;
    border-bottom: 1px solid var(--mist);
    padding: 0 max(32px, calc((100vw - 1200px) / 2));
    gap: 28px;
  }
  .mark { display: inline-flex; }
  .add { display: none; }
  .tabs { flex: none; display: flex; gap: 4px; }
  .tab { height: 64px; padding: 0 12px; }
  .tab[aria-current="page"]::after { bottom: 10px; }
  body[data-route="task"] .top { display: flex; }

  .line {
    visibility: visible;
    opacity: 1;
    transform: none;
    transition: none;
    box-shadow: none;
    padding: 10px max(32px, calc((100vw - 1200px) / 2));
  }
  .line-row { grid-template-columns: minmax(0, 1fr) auto; }
  .line-hint { position: absolute; z-index: 1; right: calc(max(32px, (100vw - 1200px) / 2) + 168px); top: 21px; pointer-events: none; }
  .key {
    display: block;
    position: absolute;
    right: 10px;
    top: 50%;
    transform: translateY(-50%);
    width: 28px;
    height: 28px;
    line-height: 26px;
    text-align: center;
    border: 1px solid var(--mist);
    border-radius: 8px;
    background: var(--white);
    color: var(--caption);
    font: 600 16px/26px var(--font);
  }
  .line-field:focus-within .key { display: none; }
  .line-field input { padding-right: 320px; }
  .line:has(input:not(:placeholder-shown)) .line-hint { display: none; }
  .line-send { padding: 0 22px; min-width: 112px; }
  .line-send svg { display: none; }
  .line-send-text { display: block; }
  .line-close { display: none; }
  .toast { bottom: 80px; }
  .line-open .toast { bottom: 80px; }
  body[data-route="task"] .toast { bottom: 24px; }

  /* матрица 2×2 с крестом из тонких линий */
  .today-grid { display: grid; grid-template-columns: minmax(0, 1fr) 320px; column-gap: 48px; align-items: start; }
  .matrix { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .cell { padding: 20px 24px 24px; min-width: 0; }
  .cell:nth-child(odd) { padding-left: 0; border-right: 1px solid var(--mist); }
  .cell:nth-child(even) { padding-right: 0; }
  .cell:nth-child(-n+2) { border-bottom: 1px solid var(--mist); padding-top: 0; }
  .cell-head { display: grid; grid-template-columns: auto minmax(0, 1fr); column-gap: 10px; align-items: center; margin-bottom: 6px; }
  .cell-head .h2 { min-width: 0; }
  .cell-head p { grid-column: 2; color: var(--caption); }
  .inbox-row { margin-bottom: 8px; }
  .today-rest, .today-phone { display: none; }
  .rail .fold:first-of-type { border-top: 0; }

  .week-grid {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(0, 1.1fr);
    grid-template-rows: auto 1fr;
    grid-template-areas: "a b" "c b";
    column-gap: 56px;
    align-items: start;
  }
  .week-a { grid-area: a; } .week-b { grid-area: b; } .week-c { grid-area: c; }
  .week-a .sec:first-child, .week-b .sec:first-child { margin-top: 0; }
  .groups { grid-template-columns: repeat(auto-fill, minmax(340px, 1fr)); gap: 32px 48px; }
  .projects { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); column-gap: 56px; }
  .person-form { max-width: 480px; }
  .page-narrow { max-width: 640px; }

  .actions {
    position: static;
    padding: 0;
    border: 0;
    margin-bottom: 4px;
  }
  body[data-route="task"] main { padding-bottom: 40px; }
  .card-grid { display: grid; grid-template-columns: minmax(0, 1fr) 360px; gap: 48px; }
  .card-col { display: grid; gap: 18px; align-content: start; min-width: 0; }
}

@media (prefers-reduced-motion: reduce) {
  .t-input { animation: none !important; transform: none !important; }
  .t-success-check { animation: none !important; opacity: 1; }
  .t-success-check svg path { animation: none !important; stroke-dashoffset: 0 !important; }
  .page-in { animation: none; }
  .primary, .btn, .chip, .ring, .chev, .task.is-leaving, .fold-panel, .fold-panel[data-open], .line, .line-open .line, .toast, .toast[data-show] { transition: none; }
}
