/* TASK BOT — единая дизайн-система сайта.
   Шкала отступов: 4 / 8 / 12 / 16 / 24. Радиусы: 6 / 10 / 14. Текст: 12 / 13 / 14 / 16 / 20. */
:root {
  color-scheme: dark;
  --bg: #0b1220;
  --side: #0e1729;
  --surface: #121c31;
  --surface-2: #17233c;
  --hover: rgba(148, 163, 184, 0.09);
  --line: rgba(148, 163, 184, 0.16);
  --line-strong: rgba(148, 163, 184, 0.3);
  --text: #e8eef8;
  --muted: #93a2bb;
  --faint: #64748b;
  --accent: #3b82f6;
  --accent-soft: rgba(59, 130, 246, 0.16);
  --ok: #34d399;
  --warn: #fbbf24;
  --danger: #f87171;
  --violet: #a78bfa;
  --sky: #38bdf8;
  --r-sm: 6px;
  --r-md: 10px;
  --r-lg: 14px;
  font-family: Inter, "Segoe UI", system-ui, sans-serif;
  font-size: 14px;
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
html, body { margin: 0; min-height: 100%; background: var(--bg); color: var(--text); line-height: 1.45; }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
button:disabled { cursor: default; opacity: 0.5; }
a { color: #7db3ff; text-decoration: underline; text-underline-offset: 2px; overflow-wrap: anywhere; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 1px; }
h1, h2, h3, p { margin: 0; }

/* ---------- Каркас ---------- */
.app { display: flex; min-height: 100vh; }
.side {
  width: 232px; flex: none; position: sticky; top: 0; height: 100vh;
  background: var(--side); border-right: 1px solid var(--line);
  display: flex; flex-direction: column; padding: 16px 12px 12px; gap: 12px;
}
.side-top { display: flex; align-items: center; gap: 4px; }
.brand { display: flex; gap: 8px; align-items: center; flex: 1; min-width: 0; }
.brand strong { font-size: 14px; letter-spacing: 0.02em; }
.brand-mark {
  width: 32px; height: 32px; border-radius: 50%; flex: none; object-fit: cover; display: block;
}
.side-tools { display: flex; flex-direction: column; gap: 8px; }
.main { flex: 1; min-width: 0; height: 100vh; overflow: auto; }
.page { max-width: 1180px; margin: 0 auto; padding: 24px 24px 64px; }

/* ---------- Кнопки и поля ---------- */
.btn, .new-task, .primary, .ghost, .danger {
  border-radius: var(--r-md); padding: 7px 12px; font-weight: 500; font-size: 13px;
  border: 1px solid var(--line); background: transparent; color: var(--text);
}
.primary, .new-task { background: var(--accent); border-color: var(--accent); color: #fff; font-weight: 600; }
.primary:hover, .new-task:hover { background: #4f8ff7; }
.new-task { width: 100%; padding: 9px 12px; }
.ghost:hover { background: var(--hover); }
.ghost.on { background: var(--accent-soft); border-color: rgba(59, 130, 246, 0.55); color: #cfe1ff; }
.danger { color: var(--danger); border-color: rgba(248, 113, 113, 0.4); }
.danger:hover { background: rgba(248, 113, 113, 0.1); }
.sm { padding: 4px 10px; font-size: 12px; }
.link-btn { border: 0; background: transparent; color: #7db3ff; padding: 2px 4px; font-size: 13px; }
.link-btn:hover { text-decoration: underline; }
.icon-btn {
  position: relative; width: 32px; height: 32px; border-radius: var(--r-md); border: 0;
  background: transparent; color: var(--muted); display: grid; place-items: center; font-size: 16px; flex: none;
}
.icon-btn:hover { background: var(--hover); color: var(--text); }
#search-toggle { display: none; }
.badge {
  position: absolute; top: -2px; right: -2px; min-width: 16px; height: 16px; padding: 0 4px;
  border-radius: 999px; background: var(--danger); color: #fff; font-size: 10px; font-weight: 700;
  display: grid; place-items: center; line-height: 1;
}
.field, .search input, select.field, textarea.field {
  width: 100%; background: var(--bg); border: 1px solid var(--line); border-radius: var(--r-md);
  padding: 8px 10px; font-size: 13px; min-width: 0;
}
textarea.field { resize: vertical; min-height: 72px; }
.field:focus, .search input:focus { outline: none; border-color: rgba(59, 130, 246, 0.8); }
.field.inline { width: auto; padding: 5px 8px; }
.search { display: block; }

/* ---------- Навигация ---------- */
nav { display: flex; flex-direction: column; gap: 2px; overflow: auto; }
.nav-btn {
  display: flex; align-items: center; justify-content: space-between; gap: 8px; text-align: left;
  border: 0; background: transparent; color: var(--muted); border-radius: var(--r-md);
  padding: 7px 10px; font-weight: 500; font-size: 13px;
}
.nav-btn:hover { background: var(--hover); color: var(--text); }
.nav-btn.active { background: var(--accent-soft); color: #cfe1ff; }
.nav-count { background: var(--danger); color: #fff; border-radius: 999px; font-size: 10px; font-weight: 700; padding: 1px 6px; }
.account {
  margin-top: auto; display: flex; gap: 8px; align-items: center; border: 0; background: transparent;
  text-align: left; padding: 8px; border-radius: var(--r-md);
}
.account:hover { background: var(--hover); }
.account-text { min-width: 0; }
.account-text strong, .account-text span { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.account-text strong { font-size: 13px; }
.account-text span { color: var(--faint); font-size: 12px; }
.avatar {
  width: 28px; height: 28px; border-radius: 50%; display: grid; place-items: center; flex: none;
  background: var(--surface-2); color: #bcd2f5; font-weight: 600; font-size: 12px;
}
.avatar.sm { width: 22px; height: 22px; font-size: 11px; }
.account-menu { background: var(--surface-2); border: 1px solid var(--line); border-radius: var(--r-md); padding: 4px; }
.account-menu button { width: 100%; border: 0; background: transparent; text-align: left; padding: 7px 8px; border-radius: var(--r-sm); font-size: 13px; }
.account-menu button:hover { background: var(--hover); }

/* ---------- Заголовок страницы и панели инструментов ---------- */
.page-head { display: flex; justify-content: space-between; gap: 12px; align-items: flex-end; margin-bottom: 16px; flex-wrap: wrap; }
.page-head h1 { font-size: 20px; font-weight: 600; letter-spacing: -0.01em; }
.page-head p { margin-top: 2px; color: var(--muted); font-size: 13px; }
.toolbar { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin-bottom: 16px; }
.toolbar .field { width: auto; }
.toolbar .grow { flex: 1; min-width: 160px; }
.seg { display: inline-flex; border: 1px solid var(--line); border-radius: var(--r-md); padding: 2px; gap: 2px; background: var(--bg); }
.seg button { border: 0; background: transparent; color: var(--muted); border-radius: 8px; padding: 4px 10px; font-size: 13px; font-weight: 500; }
.seg button:hover { color: var(--text); }
.seg button.on { background: var(--surface-2); color: var(--text); }
.menu { position: relative; display: inline-block; }
.pop {
  position: absolute; right: 0; top: calc(100% + 4px); min-width: 200px; z-index: 30;
  background: var(--surface-2); border: 1px solid var(--line-strong); border-radius: var(--r-md);
  padding: 4px; box-shadow: 0 12px 28px rgba(0, 0, 0, 0.35);
}
.pop button { display: block; width: 100%; text-align: left; border: 0; background: transparent; padding: 8px 10px; border-radius: var(--r-sm); font-size: 13px; }
.pop button:hover { background: var(--hover); }
.pop .danger-item { color: var(--danger); }

/* ---------- Группы и строки задач ---------- */
.summary { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 20px; }
.pill {
  border: 1px solid var(--line); background: transparent; border-radius: 999px; padding: 4px 12px;
  font-size: 13px; color: var(--muted);
}
.pill b { color: var(--text); font-weight: 600; margin-right: 4px; }
.pill:hover { background: var(--hover); }
.pill.hot b { color: var(--danger); }
.section { margin: 0 0 24px; }
.group-head { display: flex; align-items: center; gap: 8px; margin: 0 0 8px; font-size: 13px; font-weight: 600; color: var(--muted); }
.group-head .count { color: var(--faint); font-weight: 500; }
.group-head .link-btn { margin-left: auto; }
.group-head.late { color: var(--danger); }
.list { display: flex; flex-direction: column; border: 1px solid var(--line); border-radius: var(--r-lg); background: var(--surface); overflow: hidden; }
.trow {
  display: flex; align-items: center; gap: 12px; width: 100%; text-align: left; border: 0;
  border-bottom: 1px solid var(--line); background: transparent; padding: 10px 14px; min-height: 48px;
}
.trow:last-child { border-bottom: 0; }
.trow:hover { background: var(--hover); }
.sdot { width: 8px; height: 8px; border-radius: 50%; flex: none; background: var(--sky); }
.sdot.st-progress { background: var(--violet); }
.sdot.st-blocked { background: var(--danger); }
.sdot.st-review { background: var(--warn); }
.sdot.st-done { background: var(--ok); }
.tmain { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
button.tmain { background: transparent; border: 0; color: inherit; font: inherit; text-align: left; padding: 0; cursor: pointer; }
.ttitle { font-weight: 500; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tmeta { color: var(--faint); font-size: 12px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tflags { display: flex; gap: 6px; align-items: center; flex: none; }
.trow.done .ttitle { color: var(--muted); }
.trow.is-late { box-shadow: inset 2px 0 0 var(--danger); }
.trow.is-high { box-shadow: inset 2px 0 0 var(--warn); }
.trow.is-critical { box-shadow: inset 2px 0 0 var(--danger); }
.trow .snippet { color: var(--muted); font-size: 12px; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; overflow-wrap: anywhere; white-space: normal; }
.chip {
  font-size: 12px; border-radius: 999px; padding: 1px 8px; border: 1px solid var(--line);
  color: var(--muted); white-space: nowrap; line-height: 1.6;
}
.chip.pri-high { color: var(--warn); border-color: rgba(251, 191, 36, 0.35); }
.chip.pri-critical { color: var(--danger); border-color: rgba(248, 113, 113, 0.4); background: rgba(248, 113, 113, 0.1); }
.chip.late { color: var(--danger); border-color: rgba(248, 113, 113, 0.4); }
.chip.soon { color: var(--warn); border-color: rgba(251, 191, 36, 0.35); }
.chip.st-new { color: var(--sky); }
.chip.st-progress { color: var(--violet); }
.chip.st-blocked { color: var(--danger); }
.chip.st-review { color: var(--warn); }
.chip.st-done { color: var(--ok); }
.late { color: var(--danger); }
.muted { color: var(--muted); font-size: 13px; }

/* ---------- Состояния ---------- */
.empty { color: var(--faint); padding: 20px; text-align: center; font-size: 13px; }
.empty-card { border: 1px dashed var(--line-strong); border-radius: var(--r-lg); padding: 28px; text-align: center; color: var(--muted); }
.empty-card strong { display: block; color: var(--text); margin-bottom: 4px; }
.skeleton { height: 48px; border-radius: var(--r-md); background: linear-gradient(90deg, var(--surface) 25%, var(--surface-2) 50%, var(--surface) 75%); background-size: 200% 100%; animation: shimmer 1.2s infinite; margin-bottom: 8px; }
@keyframes shimmer { to { background-position: -200% 0; } }
.note { background: var(--accent-soft); border: 1px solid rgba(59, 130, 246, 0.3); color: #cfe1ff; border-radius: var(--r-md); padding: 10px 12px; margin-bottom: 16px; font-size: 13px; }
.note.warn { background: rgba(251, 191, 36, 0.08); border-color: rgba(251, 191, 36, 0.3); color: #fde68a; }

/* ---------- Карточки согласований ---------- */
.decision {
  display: flex; gap: 12px; align-items: center; padding: 10px 14px; border-bottom: 1px solid var(--line);
}
.decision:last-child { border-bottom: 0; }
.decision .tmain { white-space: normal; }
.decision .tmeta { white-space: normal; color: var(--muted); }

/* ---------- Доска ---------- */
.columns { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; align-items: start; }
.column { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-lg); min-height: 220px; }
.column.drop { border-color: var(--accent); background: var(--accent-soft); }
.column header { display: flex; gap: 8px; align-items: center; padding: 10px 12px; font-size: 13px; font-weight: 600; }
.column header b { margin-left: auto; color: var(--faint); font-weight: 500; }
.dot { width: 8px; height: 8px; border-radius: 50%; background: var(--sky); }
.dot.progress { background: var(--violet); }
.dot.blocked { background: var(--danger); }
.dot.review { background: var(--warn); }
.column .stack { display: flex; flex-direction: column; gap: 8px; padding: 0 8px 8px; }
.card-btn {
  display: flex; flex-direction: column; gap: 8px; width: 100%; text-align: left; background: var(--surface-2);
  border: 1px solid var(--line); border-radius: var(--r-md); padding: 10px 12px;
}
.card-btn:hover { border-color: var(--line-strong); }
.card-btn[draggable="true"] { cursor: grab; }
.card-btn.dragging { opacity: 0.45; border-style: dashed; }
.card-btn.pri-high { box-shadow: inset 2px 0 0 var(--warn); }
.card-btn.pri-critical { box-shadow: inset 2px 0 0 var(--danger); }
.card-title { font-weight: 500; display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; overflow-wrap: anywhere; }
.card-foot { display: flex; gap: 6px; align-items: center; flex-wrap: wrap; }
.card-foot .avatar { margin-left: auto; }

/* ---------- Календарь ---------- */
.calendar { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 1px; background: var(--line); border: 1px solid var(--line); border-radius: var(--r-lg); overflow: hidden; }
.cal-head { background: var(--surface); color: var(--faint); font-size: 12px; text-align: center; padding: 6px 0; }
.day { min-height: 104px; background: var(--surface); padding: 6px; display: flex; flex-direction: column; gap: 3px; cursor: pointer; min-width: 0; }
.day:hover { background: var(--surface-2); }
.day.off { background: var(--side); }
.day.picked { box-shadow: inset 0 0 0 1px var(--accent); }
.day-num { font-size: 12px; color: var(--muted); width: 22px; height: 22px; display: grid; place-items: center; border-radius: 50%; }
.day.today .day-num { background: var(--accent); color: #fff; font-weight: 600; }
.day .item {
  display: block; width: 100%; text-align: left; border: 0; background: var(--accent-soft); color: #dbe8ff;
  border-radius: 4px; padding: 1px 5px; font-size: 11px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.item.is-late { background: rgba(248, 113, 113, 0.16); color: #fecaca; }
.item.is-high { background: rgba(251, 191, 36, 0.16); color: #fde68a; }
.item.is-done { background: rgba(52, 211, 153, 0.12); color: #a7f3d0; }
.item.rem { background: transparent; border: 1px dashed var(--line-strong); color: var(--muted); }
.day .more { border: 0; background: transparent; color: var(--faint); font-size: 11px; text-align: left; padding: 0 5px; }
.week { display: flex; flex-direction: column; gap: 8px; }
.week-day { border: 1px solid var(--line); border-radius: var(--r-lg); background: var(--surface); overflow: hidden; }
.week-day.today { border-color: rgba(59, 130, 246, 0.6); }
.week-day h3 { font-size: 13px; font-weight: 600; padding: 8px 14px; border-bottom: 1px solid var(--line); color: var(--muted); }
.week-day.today h3 { color: #cfe1ff; }
.rem-row { display: flex; gap: 8px; align-items: center; padding: 8px 14px; font-size: 13px; color: var(--muted); border-bottom: 1px dashed var(--line); }
.rem-row:last-child { border-bottom: 0; }

/* ---------- Команда, метки ---------- */
.table { width: 100%; border-collapse: collapse; background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-lg); overflow: hidden; }
.table th, .table td { text-align: left; padding: 10px 12px; border-bottom: 1px solid var(--line); font-size: 13px; }
.table tr:last-child td { border-bottom: 0; }
.table th { color: var(--faint); font-weight: 500; font-size: 12px; }
.row-btn { border: 0; background: transparent; color: #9cc3ff; padding: 0; font-weight: 500; }
.labels { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 8px; margin-bottom: 16px; }
.label-card { text-align: left; background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-md); padding: 12px; width: 100%; }
.label-card:hover { border-color: var(--line-strong); }
.label-card.on { border-color: var(--accent); }
.swatch { width: 10px; height: 10px; border-radius: 50%; display: inline-block; margin-right: 4px; }
.org-card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-md); padding: 12px 14px; margin-bottom: 8px; }
.org-card p { margin-top: 4px; font-size: 13px; }
.org-card.nested { border-left: 2px solid var(--accent); }
.org-member { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin-top: 6px; }
.org-member p { margin: 0; flex: 1; min-width: 140px; }
.org-actions { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; margin-top: 10px; }

/* ---------- Карточка задачи ---------- */
.backdrop { position: fixed; inset: 0; background: rgba(3, 8, 20, 0.55); z-index: 40; }
.drawer {
  position: fixed; top: 0; right: 0; height: 100vh; width: min(520px, 100%); z-index: 41;
  background: var(--side); border-left: 1px solid var(--line-strong); overflow-y: auto; overflow-x: hidden;
  display: flex; flex-direction: column;
}
.dr-head {
  position: sticky; top: 0; z-index: 2; display: flex; gap: 8px; align-items: flex-start; padding: 14px 16px 10px;
  background: var(--side); border-bottom: 1px solid var(--line);
}
.dr-head h2 { flex: 1; min-width: 0; font-size: 16px; font-weight: 600; line-height: 1.35; overflow-wrap: anywhere; }
.dr-back { display: none; }
.dr-body { padding: 14px 16px 32px; display: flex; flex-direction: column; gap: 16px; }
.dr-chips { display: flex; gap: 6px; flex-wrap: wrap; }
.dr-actions { display: flex; gap: 8px; flex-wrap: wrap; }
.banner { border-radius: var(--r-md); padding: 10px 12px; font-size: 13px; border: 1px solid var(--line); background: var(--surface); }
.banner.warn { background: rgba(251, 191, 36, 0.08); border-color: rgba(251, 191, 36, 0.3); color: #fde68a; }
.banner.info { background: var(--accent-soft); border-color: rgba(59, 130, 246, 0.35); color: #dbe8ff; }
.banner .row { margin-top: 8px; }
.block-title { font-size: 12px; font-weight: 600; color: var(--faint); text-transform: uppercase; letter-spacing: 0.06em; margin-bottom: 6px; }
.rich { overflow-wrap: anywhere; word-break: break-word; white-space: pre-wrap; }
.result-box { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-md); padding: 10px 12px; }
.props { display: grid; grid-template-columns: 96px minmax(0, 1fr); gap: 8px 12px; align-items: center; font-size: 13px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-md); padding: 12px; }
.props dt { color: var(--faint); }
.props dd { margin: 0; min-width: 0; display: flex; gap: 6px; align-items: center; flex-wrap: wrap; overflow-wrap: anywhere; }
.props .field { padding: 5px 8px; }
.comment { display: flex; gap: 10px; margin-bottom: 12px; }
.comment .body { min-width: 0; flex: 1; }
.comment .who { font-size: 12px; color: var(--muted); margin-bottom: 2px; }
.comment .who b { color: var(--text); font-weight: 600; }
.history-box summary { cursor: pointer; color: var(--muted); font-size: 13px; font-weight: 500; }
.history { list-style: none; padding: 0; margin: 8px 0 0; }
.history li { margin: 0; padding: 6px 0 6px 12px; border-left: 1px solid var(--line-strong); color: var(--muted); font-size: 12px; overflow-wrap: anywhere; }
.comment-form { display: flex; flex-direction: column; gap: 8px; margin-top: 8px; }

/* ---------- Диалоги, уведомления ---------- */
.modal {
  position: fixed; inset: 0; margin: auto; z-index: 60; width: min(460px, calc(100% - 24px));
  height: fit-content; max-height: calc(100vh - 32px); overflow: auto;
  background: var(--surface); border: 1px solid var(--line-strong); border-radius: var(--r-lg); padding: 18px;
}
.modal h2 { font-size: 16px; margin-bottom: 4px; }
.stack-form { display: flex; flex-direction: column; gap: 10px; }
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.form-row.three { grid-template-columns: 1fr 1fr 1fr; }
.field-label { font-size: 12px; color: var(--faint); display: flex; flex-direction: column; gap: 4px; }
.quick { display: flex; gap: 6px; flex-wrap: wrap; }
.row { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.row.end { justify-content: flex-end; }
.toast {
  position: fixed; bottom: 16px; left: 50%; transform: translateX(-50%); z-index: 80; max-width: min(440px, calc(100% - 24px));
  background: #3b1d24; border: 1px solid rgba(248, 113, 113, 0.5); color: #fecaca; padding: 9px 14px; border-radius: var(--r-md); font-size: 13px;
}
.toast.info { background: #14274a; border-color: rgba(59, 130, 246, 0.5); color: #dbe8ff; }
.toast.ok { background: #0f2f26; border-color: rgba(52, 211, 153, 0.45); color: #a7f3d0; }
.inbox {
  position: fixed; top: 52px; left: 12px; width: min(380px, calc(100% - 24px)); max-height: calc(100vh - 72px); overflow: auto; z-index: 50;
  background: var(--surface-2); border: 1px solid var(--line-strong); border-radius: var(--r-lg); box-shadow: 0 16px 36px rgba(0, 0, 0, 0.4);
}
.inbox-head { display: flex; align-items: center; justify-content: space-between; padding: 10px 14px; border-bottom: 1px solid var(--line); font-weight: 600; font-size: 13px; }
.inbox-item { display: flex; gap: 10px; width: 100%; text-align: left; padding: 10px 14px; border: 0; border-bottom: 1px solid var(--line); background: transparent; }
.inbox-item:hover { background: var(--hover); }
.inbox-item.unread::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: var(--accent); margin-top: 6px; flex: none; }
.inbox-item .t { font-size: 13px; font-weight: 500; overflow-wrap: anywhere; }
.inbox-item .x { font-size: 12px; color: var(--muted); margin-top: 2px; overflow-wrap: anywhere; }
.inbox-item .w { font-size: 11px; color: var(--faint); margin-top: 2px; }
.inbox-actions { display: flex; gap: 6px; margin-top: 6px; }
.fab {
  position: fixed; right: 16px; bottom: 16px; z-index: 20; width: 52px; height: 52px; border-radius: 50%;
  border: 0; background: var(--accent); color: #fff; font-size: 26px; line-height: 1; box-shadow: 0 8px 20px rgba(0, 0, 0, 0.4);
}

/* ---------- Инструкция ---------- */
.guide-grid { display: grid; grid-template-columns: 200px minmax(0, 1fr); gap: 24px; align-items: start; }
.guide-nav { position: sticky; top: 16px; display: flex; flex-direction: column; gap: 2px; }
.guide-nav button { text-align: left; border: 0; background: transparent; color: var(--muted); padding: 6px 10px; border-radius: var(--r-sm); font-size: 13px; }
.guide-nav button:hover { background: var(--hover); color: var(--text); }
.guide-topic { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-lg); padding: 14px 16px; margin-bottom: 12px; }
.guide-topic h2 { font-size: 15px; margin-bottom: 4px; }
.guide-topic ol { margin: 8px 0 0; padding-left: 20px; display: flex; flex-direction: column; gap: 4px; }
.guide-topic .example { margin-top: 8px; padding: 8px 10px; border-left: 2px solid var(--accent); background: var(--accent-soft); border-radius: 0 var(--r-sm) var(--r-sm) 0; font-size: 13px; }
.guide-topic .who { display: inline-block; margin-bottom: 6px; }

/* ---------- Вход ---------- */
.gate { min-height: 100vh; display: grid; place-items: center; padding: 24px; }
.gate-card { width: min(420px, 100%); background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-lg); padding: 28px; }
.gate-card h1 { margin: 16px 0 8px; font-size: 22px; }
.gate-card p { color: var(--muted); line-height: 1.5; margin-bottom: 16px; }

/* ---------- Планшет ---------- */
@media (max-width: 1100px) {
  .columns { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

/* ---------- Телефон ---------- */
@media (max-width: 800px) {
  .app { display: block; }
  .side { position: sticky; top: 0; z-index: 10; width: auto; height: auto; padding: 8px 12px 0; gap: 4px; border-right: 0; border-bottom: 1px solid var(--line); }
  .side-top { padding-right: 44px; }
  #search-toggle { display: grid; }
  .side-tools { display: none; flex-direction: row; padding-bottom: 8px; }
  .side.search-open .side-tools { display: flex; }
  .side-tools .new-task { display: none; }
  nav { flex-direction: row; overflow-x: auto; gap: 0; padding-bottom: 4px; scrollbar-width: none; }
  .nav-btn { white-space: nowrap; padding: 8px 12px; border-radius: var(--r-sm); }
  .account { position: absolute; top: 8px; right: 12px; margin: 0; padding: 0; }
  .account-text { display: none; }
  .account-menu { position: absolute; top: 44px; right: 12px; width: 200px; z-index: 30; }
  .inbox { top: 52px; left: 8px; right: 8px; width: auto; }
  .main { height: auto; overflow: visible; }
  .page { padding: 16px 12px 88px; }
  .fab { display: block; }
  .columns { display: flex; overflow-x: auto; scroll-snap-type: x mandatory; gap: 10px; padding-bottom: 8px; }
  .column { flex: 0 0 78%; scroll-snap-align: start; }
  .trow { padding: 10px 12px; }
  .tflags .chip.st-new, .tflags .chip.st-progress { display: none; }
  .day { min-height: 56px; padding: 4px; }
  .day .item, .day .more { display: none; }
  .day .dots { display: flex; gap: 2px; flex-wrap: wrap; }
  .day .dots i { width: 5px; height: 5px; border-radius: 50%; background: var(--accent); }
  .day .dots i.late { background: var(--danger); }
  .day .dots i.rem { background: transparent; border: 1px dashed var(--muted, #8b9ab4); width: 5px; height: 5px; box-sizing: border-box; }
  .table { display: block; overflow-x: auto; }
  .drawer { width: 100%; border-left: 0; }
  .dr-back { display: inline-flex; }
  .dr-close { display: none; }
  .form-row, .form-row.three { grid-template-columns: 1fr; }
  .props { grid-template-columns: 84px minmax(0, 1fr); }
  .guide-grid { grid-template-columns: 1fr; gap: 12px; }
  .guide-nav { position: static; flex-direction: row; overflow-x: auto; }
  .guide-nav button { white-space: nowrap; }
}
@media (min-width: 801px) {
  .day .dots { display: none; }
  .fab { display: none !important; }
}
