/* Веб-приложение ассистента. Светлая и тёмная темы — по настройке системы. */

:root {
  --bg: #f5f4fa;
  --card: #ffffff;
  --text: #17151f;
  --muted: #6c6882;
  --faint: #a19db3;
  --line: #ebe8f3;
  --accent: #5b4fe0;
  --accent-2: #8a5cf6;
  --accent-soft: #eeebfe;
  --accent-text: #4b3fd1;
  --ok: #15a34a;
  --ok-soft: #e4f6ea;
  --warn: #c2570c;
  --warn-soft: #fdf0e3;
  --danger: #d0303a;
  --danger-soft: #fcebec;
  --radius: 18px;
  --radius-s: 12px;
  --shadow: 0 1px 2px rgba(23, 18, 60, .04), 0 6px 20px rgba(23, 18, 60, .05);
  --hero: linear-gradient(135deg, #5b4fe0 0%, #7a4fe8 55%, #9b5cf6 100%);
  color-scheme: light;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0f0e15;
    --card: #1a1823;
    --text: #eeecf5;
    --muted: #9d99b2;
    --faint: #6d6982;
    --line: #2a2736;
    --accent: #8f85ff;
    --accent-2: #b08cff;
    --accent-soft: #262245;
    --accent-text: #b3acff;
    --ok: #4ade80;
    --ok-soft: #173024;
    --warn: #fb9a4b;
    --warn-soft: #36230f;
    --danger: #f87171;
    --danger-soft: #3a1b1e;
    --shadow: none;
    --hero: linear-gradient(135deg, #3f35b8 0%, #5a36bf 55%, #7440d0 100%);
    color-scheme: dark;
  }
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }

html, body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 16px/1.45 -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue",
    sans-serif;
  -webkit-text-size-adjust: 100%;
  -webkit-font-smoothing: antialiased;
}

button, input, textarea { font: inherit; color: inherit; }
button { -webkit-tap-highlight-color: transparent; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

svg { width: 1em; height: 1em; fill: none; stroke: currentColor; stroke-width: 2;
  stroke-linecap: round; stroke-linejoin: round; }

/* ---------- Каркас ---------- */

.top {
  position: sticky;
  top: 0;
  z-index: 6;
  padding: calc(env(safe-area-inset-top) + 14px) 18px 10px;
  background: color-mix(in srgb, var(--bg) 86%, transparent);
  backdrop-filter: saturate(1.4) blur(14px);
  -webkit-backdrop-filter: saturate(1.4) blur(14px);
}

.top-inner {
  max-width: 640px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.top h1 { margin: 0; font-size: 30px; line-height: 1.1; font-weight: 750; letter-spacing: -.02em; }

.status-pill {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  font-size: 13px;
  color: var(--muted);
  padding: 5px 11px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: var(--card);
  cursor: pointer;
  white-space: nowrap;
}

.status-pill::before {
  content: "";
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--ok);
  box-shadow: 0 0 0 3px var(--ok-soft);
}

.status-pill.off::before { background: var(--faint); box-shadow: none; }

main {
  max-width: 640px;
  margin: 0 auto;
  padding: 6px 16px calc(104px + env(safe-area-inset-bottom));
}

.center { min-height: 70vh; display: grid; place-items: center; }

/* ---------- Карточки и секции ---------- */

.card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 14px 16px;
  margin: 0 0 10px;
  animation: rise .28s ease both;
}

@keyframes rise {
  from { opacity: 0; transform: translateY(6px); }
  to { opacity: 1; transform: none; }
}

.block { margin-top: 22px; }

h2 {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 8px;
  font-size: 13px;
  text-transform: uppercase;
  letter-spacing: .06em;
  color: var(--muted);
  margin: 0 6px 8px;
  font-weight: 650;
}

h2.warn { color: var(--warn); }

.muted { color: var(--muted); }
.small { font-size: 13px; }
.meta { font-size: 13px; color: var(--muted); margin-top: 3px; }
.empty { color: var(--muted); }

.skeleton {
  height: 14px;
  margin: 10px 0;
  border-radius: 7px;
  background: linear-gradient(90deg, var(--line) 25%, var(--bg) 50%, var(--line) 75%);
  background-size: 200% 100%;
  animation: shimmer 1.2s infinite linear;
}

.skeleton:nth-child(2n) { width: 70%; }

@keyframes shimmer { to { background-position: -200% 0; } }

/* ---------- Кнопки ---------- */

.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  min-height: 40px;
  border: 1px solid var(--line);
  background: var(--card);
  border-radius: var(--radius-s);
  padding: 8px 15px;
  cursor: pointer;
  font-weight: 550;
  text-decoration: none;
  color: var(--text);
  transition: transform .1s ease, background .15s ease;
}

.button:active { transform: scale(.97); }
.button.primary { background: var(--accent); border-color: var(--accent); color: #fff; }
.button.danger { color: var(--danger); }
.button.wide { width: 100%; }
.button:disabled, .chip:disabled { opacity: .55; cursor: default; }
.loading { position: relative; color: transparent !important; }

.loading::after {
  content: "";
  position: absolute;
  inset: 0;
  margin: auto;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  border: 2px solid var(--muted);
  border-top-color: transparent;
  animation: spin .7s linear infinite;
}

.button.primary.loading::after { border-color: #fff; border-top-color: transparent; }

@keyframes spin { to { transform: rotate(360deg); } }

.actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 12px; }

.link-button {
  border: 0;
  background: none;
  color: var(--accent-text);
  font-size: 13px;
  font-weight: 600;
  text-transform: none;
  letter-spacing: 0;
  cursor: pointer;
  padding: 0;
}

.chips { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 10px; }

.chip {
  border: 1px solid var(--line);
  background: var(--bg);
  border-radius: 999px;
  padding: 6px 12px;
  font-size: 14px;
  font-weight: 550;
  cursor: pointer;
  transition: transform .1s ease;
}

.chip:active { transform: scale(.96); }
.chip.ok { background: var(--ok-soft); border-color: transparent; color: var(--ok); }
.chip.danger { color: var(--danger); }
.chip.accent { background: var(--accent-soft); border-color: transparent; color: var(--accent-text); }

/* ---------- Ввод ---------- */

.composer {
  display: flex;
  gap: 8px;
  align-items: flex-end;
  padding: 6px;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 22px;
  box-shadow: var(--shadow);
  transition: border-color .15s ease, box-shadow .15s ease;
}

.composer:focus-within {
  border-color: var(--accent);
  box-shadow: 0 0 0 4px var(--accent-soft);
}

.composer textarea {
  flex: 1;
  overflow-y: hidden;
  min-height: 42px;
  max-height: 180px;
  resize: none;
  padding: 10px 10px 10px 12px;
  border: 0;
  background: none;
  outline: none;
}

.send {
  flex: none;
  display: grid;
  place-items: center;
  width: 42px;
  height: 42px;
  border-radius: 50%;
  border: 0;
  background: var(--accent);
  color: #fff;
  font-size: 19px;
  cursor: pointer;
}

.send svg { stroke-width: 2.2; margin-left: -2px; }

.answer { margin-top: 10px; }
.answer-card { padding: 10px 14px; }
.answer-card.thinking { color: var(--muted); }
.line { display: flex; gap: 10px; align-items: flex-start; margin: 5px 0; white-space: pre-wrap; }
.line.block-line { display: block; }
.line.problem { color: var(--danger); }

.line-icon {
  flex: none;
  display: grid;
  place-items: center;
  width: 22px;
  height: 22px;
  margin-top: 1px;
  border-radius: 50%;
  background: var(--accent-soft);
  color: var(--accent-text);
  font-size: 13px;
  font-weight: 700;
}

.line-icon.ok { background: var(--ok-soft); color: var(--ok); }

/* ---------- Главное на сегодня ---------- */

.hero {
  margin-top: 16px;
  padding: 20px 20px 18px;
  border-radius: 24px;
  background: var(--hero);
  color: #fff;
  box-shadow: 0 10px 30px rgba(91, 79, 224, .28);
  animation: rise .3s ease both;
}

.hero-date { font-size: 14px; font-weight: 600; opacity: .85; }
.hero-story { margin: 8px 0 0; font-size: 18px; line-height: 1.45; font-weight: 520; }
.progress { margin-top: 16px; }

.bar {
  height: 6px;
  border-radius: 3px;
  background: rgba(255, 255, 255, .25);
  overflow: hidden;
}

.bar span {
  display: block;
  height: 100%;
  border-radius: 3px;
  background: #fff;
  transition: width .5s ease;
}

.progress-label { margin-top: 7px; font-size: 13px; opacity: .85; }

/* ---------- Строки дел ---------- */

.list { padding: 2px 0; }

.row {
  display: flex;
  gap: 12px;
  align-items: flex-start;
  padding: 11px 14px;
  border-top: 1px solid var(--line);
  transition: background .2s ease, opacity .2s ease;
}

.row:first-child { border-top: 0; }

.row .time {
  flex: none;
  width: 86px;
  padding-top: 2px;
  font-size: 14px;
  font-variant-numeric: tabular-nums;
  color: var(--muted);
}

.row .body { flex: 1; min-width: 0; }
.row .title { overflow-wrap: anywhere; }
.row .title.priority::before { content: "❗ "; }
.row.done { opacity: .6; }
.row.done .title { text-decoration: line-through; text-decoration-color: var(--faint); }
.row.is-now, .row.is-next { background: var(--accent-soft); }
.list .row.is-now:first-child, .list .row.is-next:first-child { border-radius: 17px 17px 0 0; }
.row.is-now .time, .row.is-next .time { color: var(--accent-text); font-weight: 650; }

.tag {
  display: inline-block;
  margin-left: 8px;
  padding: 1px 8px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 650;
  vertical-align: 1px;
  background: var(--card);
  color: var(--accent-text);
}

.tag.now { background: var(--accent); color: #fff; }

.check {
  flex: none;
  display: grid;
  place-items: center;
  width: 24px;
  height: 24px;
  margin-top: 1px;
  border-radius: 50%;
  border: 2px solid var(--faint);
  background: none;
  color: transparent;
  font-size: 15px;
  cursor: pointer;
  padding: 0;
  transition: background .15s ease, border-color .15s ease, transform .15s ease;
}

.check svg { stroke-width: 3; }
.check:hover { border-color: var(--ok); color: var(--ok); }
.check.checked { background: var(--ok); border-color: var(--ok); color: #fff; animation: pop .25s ease; }
.check.ghost { border-style: dashed; cursor: default; }
.check.ghost:hover { border-color: var(--faint); }

@keyframes pop { 50% { transform: scale(1.18); } }

.more {
  flex: none;
  display: grid;
  place-items: center;
  width: 30px;
  height: 30px;
  margin: -3px -6px 0 0;
  border: 0;
  border-radius: 50%;
  background: none;
  color: var(--faint);
  font-size: 18px;
  cursor: pointer;
}

.more svg { fill: currentColor; stroke: none; }
.more:hover { background: var(--bg); color: var(--muted); }

/* ---------- Обещания ---------- */

.promise { border-left: 4px solid var(--accent); }
.promise.late { border-left-color: var(--warn); }
.promise-text { font-weight: 550; }

/* ---------- Планы ---------- */

.plan-rows { display: grid; gap: 2px; }

.plan-row {
  display: flex;
  gap: 12px;
  padding: 7px 10px;
  border-radius: 10px;
  color: var(--muted);
}

.plan-row.planned { color: var(--text); background: var(--accent-soft); font-weight: 600; }

.plan-time {
  flex: none;
  width: 92px;
  font-size: 14px;
  font-variant-numeric: tabular-nums;
  padding-top: 1px;
}

.comment {
  margin: 10px 0 0;
  padding: 10px 12px;
  border-radius: 12px;
  background: var(--bg);
  font-size: 14px;
  color: var(--muted);
}

.invite {
  width: 100%;
  display: flex;
  gap: 14px;
  align-items: center;
  text-align: left;
  cursor: pointer;
  border-style: dashed;
  box-shadow: none;
  background: transparent;
}

.invite:hover { border-color: var(--accent); }

.invite-icon {
  flex: none;
  display: grid;
  place-items: center;
  width: 40px;
  height: 40px;
  border-radius: 12px;
  background: var(--accent-soft);
  color: var(--accent-text);
  font-size: 20px;
}

.invite-icon svg { stroke-width: 1.8; }

.week-day { padding: 8px 0; border-top: 1px solid var(--line); }
.week-day:first-child { border-top: 0; padding-top: 0; }
.week-title { font-weight: 650; margin-bottom: 6px; }
.week-tasks { display: flex; flex-wrap: wrap; gap: 6px; }

.pill {
  padding: 4px 10px;
  border-radius: 999px;
  background: var(--accent-soft);
  color: var(--accent-text);
  font-size: 14px;
}

.pill.priority { background: var(--warn-soft); color: var(--warn); }

/* ---------- Память ---------- */

.entity summary {
  display: flex;
  gap: 12px;
  align-items: center;
  cursor: pointer;
  list-style: none;
}

.entity summary::-webkit-details-marker { display: none; }

.avatar {
  flex: none;
  display: grid;
  place-items: center;
  width: 38px;
  height: 38px;
  border-radius: 50%;
  background: var(--accent-soft);
  color: var(--accent-text);
  font-weight: 700;
}

.avatar.project { border-radius: 11px; background: var(--warn-soft); color: var(--warn); }
.avatar.chat, .avatar.mic { font-size: 17px; background: var(--bg); }
.entity-head { display: grid; min-width: 0; }
.entity .name { font-weight: 650; }

.entity .lead {
  color: var(--muted);
  font-size: 14px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.entity[open] .lead { display: none; }
.entity .full { white-space: pre-wrap; margin-top: 12px; }

.entity textarea {
  width: 100%;
  min-height: 140px;
  margin-top: 12px;
  padding: 10px 12px;
  border-radius: 12px;
  border: 1px solid var(--line);
  background: var(--bg);
}

.tidy { border-color: var(--accent); }

.tidy-head {
  display: flex;
  align-items: center;
  gap: 8px;
  font-weight: 650;
  color: var(--accent-text);
}

.tidy-row {
  display: flex;
  gap: 12px;
  align-items: center;
  justify-content: space-between;
  padding: 10px 0;
  border-top: 1px solid var(--line);
}

.tidy-head + .tidy-row { margin-top: 8px; }

/* ---------- Разговоры ---------- */

.segments {
  display: flex;
  gap: 4px;
  padding: 4px;
  margin-top: 6px;
  border-radius: 14px;
  background: var(--line);
}

.segment {
  flex: 1;
  border: 0;
  border-radius: 10px;
  padding: 7px 8px;
  background: none;
  font-size: 14px;
  font-weight: 600;
  color: var(--muted);
  cursor: pointer;
}

.segment.active { background: var(--card); color: var(--text); box-shadow: var(--shadow); }

.phrases { display: grid; gap: 6px; margin-top: 12px; }

.bubble {
  max-width: 88%;
  margin: 0;
  padding: 8px 12px;
  border-radius: 16px;
  font-size: 15px;
  white-space: pre-wrap;
}

.bubble b { display: block; font-size: 13px; color: var(--accent-text); }
.bubble time { display: block; font-size: 11px; color: var(--faint); margin-top: 2px; text-align: right; }
.bubble.me { justify-self: end; background: var(--accent-soft); border-bottom-right-radius: 6px; }
.bubble.other { justify-self: start; background: var(--bg); border-bottom-left-radius: 6px; }

/* ---------- Слух ---------- */

.listen-card { margin-top: 16px; }
.listen-status { display: flex; align-items: center; gap: 10px; }
.status-big { font-size: 22px; font-weight: 700; }

.dot {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: var(--ok);
  box-shadow: 0 0 0 4px var(--ok-soft);
  animation: pulse 2s ease infinite;
}

.dot.off { background: var(--faint); box-shadow: none; animation: none; }

@keyframes pulse { 50% { box-shadow: 0 0 0 7px var(--ok-soft); } }

.cost-top { display: flex; gap: 28px; }
.cost-big { display: block; font-size: 24px; font-weight: 750; font-variant-numeric: tabular-nums; }
.cost-rows { margin-top: 12px; border-top: 1px solid var(--line); padding-top: 6px; }

.cost-row {
  display: flex;
  justify-content: space-between;
  padding: 5px 0;
  font-size: 14px;
  color: var(--muted);
}

.cost-row b { color: var(--text); font-weight: 600; font-variant-numeric: tabular-nums; }

.shop-add {
  display: flex;
  gap: 8px;
  padding: 10px 14px;
  border-top: 1px solid var(--line);
}

.shop-add input {
  flex: 1;
  min-width: 0;
  border: 0;
  background: none;
  outline: none;
}

/* ---------- Вход ---------- */

.login { max-width: 400px; text-align: center; padding: 28px 24px; }
.login p { margin: 0 0 14px; }

.login-mark {
  display: grid;
  place-items: center;
  width: 56px;
  height: 56px;
  margin: 0 auto 12px;
  border-radius: 18px;
  background: var(--hero);
  color: #fff;
  font-size: 28px;
}

.login-title { justify-content: center; font-size: 20px; text-transform: none; letter-spacing: 0;
  color: var(--text); margin: 0 0 8px; }

/* ---------- Вкладки ---------- */

.tabs {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 6;
  display: flex;
  justify-content: center;
  gap: 2px;
  padding: 6px 8px calc(6px + env(safe-area-inset-bottom));
  background: color-mix(in srgb, var(--card) 88%, transparent);
  backdrop-filter: saturate(1.4) blur(14px);
  -webkit-backdrop-filter: saturate(1.4) blur(14px);
  border-top: 1px solid var(--line);
}

.tab {
  flex: 1;
  max-width: 120px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 3px;
  border: 0;
  background: none;
  padding: 6px 2px;
  border-radius: 12px;
  font-size: 11px;
  font-weight: 600;
  color: var(--faint);
  cursor: pointer;
}

.tab svg { font-size: 23px; stroke-width: 1.8; }
.tab.active { color: var(--accent-text); }
.tab.active svg { stroke-width: 2.2; }

/* ---------- Меню снизу и уведомления ---------- */

.sheet { position: fixed; inset: 0; z-index: 20; }

.sheet-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(10, 8, 20, .35);
  opacity: 0;
  transition: opacity .18s ease;
}

.sheet-panel {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  max-width: 520px;
  margin: 0 auto;
  padding: 10px 12px calc(12px + env(safe-area-inset-bottom));
  border-radius: 22px 22px 0 0;
  background: var(--card);
  transform: translateY(100%);
  transition: transform .2s ease;
}

.sheet.open .sheet-backdrop { opacity: 1; }
.sheet.open .sheet-panel { transform: none; }

.sheet-title {
  padding: 8px 10px 12px;
  font-size: 14px;
  color: var(--muted);
  text-align: center;
  overflow-wrap: anywhere;
}

.sheet-button {
  display: block;
  width: 100%;
  padding: 14px;
  margin-top: 6px;
  border: 0;
  border-radius: 14px;
  background: var(--bg);
  font-weight: 600;
  cursor: pointer;
}

.sheet-button.danger { color: var(--danger); }
.sheet-button.primary { background: var(--accent); color: #fff; }

.nudge-text {
  width: 100%;
  min-height: 96px;
  padding: 12px 14px;
  border-radius: 14px;
  border: 1px solid var(--line);
  background: var(--bg);
  resize: vertical;
}
.sheet-button.cancel { background: none; color: var(--muted); }

.toast {
  position: fixed;
  left: 50%;
  bottom: calc(88px + env(safe-area-inset-bottom));
  transform: translateX(-50%);
  max-width: calc(100% - 32px);
  background: var(--text);
  color: var(--bg);
  padding: 10px 16px;
  border-radius: 14px;
  font-size: 14px;
  font-weight: 550;
  z-index: 30;
  box-shadow: 0 8px 24px rgba(0, 0, 0, .18);
}

.toast.show { animation: toast-in .22s ease; }

@keyframes toast-in {
  from { opacity: 0; transform: translate(-50%, 8px); }
  to { opacity: 1; transform: translate(-50%, 0); }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
}

/* ---------- Проекты ---------- */
.card.project { display: flex; flex-direction: column; gap: 4px; width: 100%; text-align: left;
  font: inherit; color: inherit; border: 0; cursor: pointer; margin-bottom: 10px; }
.card.project.stuck { box-shadow: inset 3px 0 0 var(--warn), var(--shadow); }
.project-head { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; font-size: 17px; }
.project-line { font-size: 14px; }
.project-title { margin: 0 0 4px; font-size: 22px; }
.project-card-text { white-space: pre-line; margin-top: 12px; padding-top: 12px;
  border-top: 1px solid var(--line); }
.link-button.back { margin: 0 0 10px; }
.row.idea { align-items: center; gap: 8px; }
.row.idea .chip { margin: 0; white-space: nowrap; }

/* ---------- Время за неделю ---------- */
.bars { display: grid; gap: 7px; margin: 12px 0 6px; }
.bar-row { display: grid; grid-template-columns: 46px 1fr 52px; align-items: center; gap: 8px;
  font-size: 13px; }
.bar-label { color: var(--muted); }
.bar { display: flex; height: 12px; border-radius: 6px; overflow: hidden; background: var(--line); }
.bar-total { text-align: right; color: var(--muted); font-variant-numeric: tabular-nums; }
.bar-part.work { background: #6a5cf0; }
.bar-part.comm { background: #3aa3e3; }
.bar-part.fun { background: #f0a03c; }
.bar-part.music { background: #3fbf8f; }
.bar-part.other { background: #a19db3; }
.legend { display: flex; flex-wrap: wrap; gap: 12px; font-size: 12px; color: var(--muted);
  margin-bottom: 6px; }
.legend i { display: inline-block; width: 9px; height: 9px; border-radius: 50%;
  margin-right: 5px; vertical-align: -1px; }

/* ---------- Документы, шаги, настройки, поиск ---------- */

.attach {
  flex: none;
  display: grid;
  place-items: center;
  width: 42px;
  height: 42px;
  border-radius: 50%;
  color: var(--muted);
  font-size: 21px;
  cursor: pointer;
}
.attach:hover { color: var(--accent-text); background: var(--accent-soft); }

.toast-action {
  margin-left: 8px;
  padding: 0;
  border: 0;
  background: none;
  color: var(--accent-2);
  font-weight: 750;
  cursor: pointer;
}

.doc-title { font-size: 16px; overflow-wrap: anywhere; }
.doc p { margin: 6px 0 0; }
.doc-part { margin-top: 10px; }
.doc-part summary { cursor: pointer; font-weight: 600; }
.doc-line { font-size: 14px; padding: 3px 0; overflow-wrap: anywhere; }

.row.step .title { font-weight: 600; }
.row.step .chip, .row.setting .chip { flex: none; margin: 0; }
.row.setting { align-items: center; gap: 6px; }

.switch {
  position: relative;
  flex: none;
  width: 46px;
  height: 28px;
  padding: 0;
  border: 0;
  border-radius: 14px;
  background: var(--line);
  cursor: pointer;
  transition: background .15s ease;
}
.switch span {
  position: absolute;
  top: 3px;
  left: 3px;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 1px 3px rgba(0, 0, 0, .25);
  transition: transform .15s ease;
}
.switch.on { background: var(--ok); }
.switch.on span { transform: translateX(18px); }

.search {
  display: flex;
  gap: 8px;
  align-items: center;
  margin-bottom: 12px;
  padding: 6px 6px 6px 14px;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 22px;
  box-shadow: var(--shadow);
}
.search:focus-within { border-color: var(--accent); box-shadow: 0 0 0 4px var(--accent-soft); }
.search svg { flex: none; color: var(--faint); font-size: 18px; }
.search input { flex: 1; min-width: 0; padding: 8px 0; border: 0; background: none; outline: none; }
.search .chip { margin: 0; }
.answer-card.find { margin-bottom: 12px; white-space: pre-wrap; }

/* ---------- Люди и обязательства ---------- */

.avatar.late { background: var(--warn-soft); color: var(--warn); }
.tag.late { background: var(--warn-soft); color: var(--warn); margin-left: 8px; }
.duties { display: grid; margin-top: 12px; }
.duties-title {
  font-size: 12px;
  font-weight: 650;
  letter-spacing: .05em;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: 2px;
}
.duty {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
  padding: 8px 0;
  border-top: 1px solid var(--line);
}
.duty:first-of-type { border-top: 0; }
.duty.late > div:first-child { color: var(--warn); }
.duty .chip { flex: none; margin: 0; }


/* ---------- Правка дела, накладки, перетаскивание ---------- */

.meta.warn, .line.warn { color: var(--warn); }
.row .body[data-edit] { cursor: pointer; }
.row[draggable="true"] { cursor: grab; }
.row.dragging { opacity: .4; }
.drop-day.drop-over .card { box-shadow: 0 0 0 2px var(--accent); }
.drop-day.empty-day { display: none; }
.week-dragging .drop-day.empty-day { display: block; }
.peer-link { color: inherit; text-decoration: underline; text-decoration-color: var(--faint); }

.edit-form { max-height: 92vh; overflow-y: auto; }
.edit-form .chips { margin-top: 8px; }
.field { display: block; margin-top: 10px; }
.field > span { display: block; margin: 0 4px 4px; font-size: 13px; color: var(--muted); }
.field input, .field textarea {
  width: 100%;
  padding: 11px 13px;
  border-radius: 12px;
  border: 1px solid var(--line);
  background: var(--bg);
  color: var(--text);
  font: inherit;
}
.field textarea { min-height: 72px; resize: vertical; }
.field-row { display: flex; flex-wrap: wrap; gap: 8px; align-items: flex-end; }
.field-row .field { flex: 1 1 88px; min-width: 0; }
.field-row .field.wide { flex: 2 1 130px; }
.field.check-field { display: flex; flex: 0 0 auto; align-items: center; gap: 8px; padding: 0 4px 12px; }
.field.check-field input { width: auto; }
.field.check-field span { margin: 0; font-size: 15px; color: var(--text); }

/* ---------- На утверждение ---------- */

.row.suggest { align-items: center; }
.row.suggest .chip { flex: none; min-width: 40px; justify-content: center; }
