/* ============================================================
   Focus Center — design system
   Тёмная тема, mobile-first, без внешних зависимостей.
   ============================================================ */

:root {
  --bg: #070a0f;
  --bg-2: #0b1017;
  --surface: rgba(255, 255, 255, 0.045);
  --surface-2: rgba(255, 255, 255, 0.075);
  --surface-3: rgba(255, 255, 255, 0.11);
  --line: rgba(255, 255, 255, 0.08);
  --line-2: rgba(255, 255, 255, 0.14);
  --text: #e9eff8;
  --muted: #93a2b7;
  --dim: #67758b;
  --accent: #5eead4;
  --accent-2: #38bdf8;
  --violet: #a78bfa;
  --danger: #fb7185;
  --warn: #fbbf24;
  --ok: #34d399;
  --hot: #fb923c;
  --radius: 18px;
  --radius-sm: 12px;
  --shadow: 0 24px 60px -28px rgba(0, 0, 0, 0.9);
  --tabbar-h: 62px;
  --safe-b: env(safe-area-inset-bottom, 0px);
  --font: "Inter", "SF Pro Text", -apple-system, "Segoe UI", Roboto, system-ui, sans-serif;
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
html { -webkit-text-size-adjust: 100%; }
body {
  font-family: var(--font);
  background: var(--bg);
  color: var(--text);
  font-size: 15px;
  line-height: 1.45;
  min-height: 100dvh;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
}
body::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: -1;
  background:
    radial-gradient(60% 50% at 12% -5%, rgba(94, 234, 212, 0.13), transparent 65%),
    radial-gradient(55% 45% at 92% 0%, rgba(56, 189, 248, 0.12), transparent 60%),
    radial-gradient(70% 60% at 50% 110%, rgba(167, 139, 250, 0.09), transparent 70%),
    linear-gradient(180deg, var(--bg-2), var(--bg) 45%);
  pointer-events: none;
}

[hidden] { display: none !important; }
a { color: inherit; text-decoration: none; }
button { font: inherit; color: inherit; }
h1, h2, h3, h4, p { margin: 0; }
ul, ol { margin: 0; padding: 0; list-style: none; }
::selection { background: rgba(94, 234, 212, 0.28); }
:focus-visible { outline: 2px solid rgba(94, 234, 212, 0.8); outline-offset: 2px; border-radius: 6px; }
input[type="checkbox"] { accent-color: var(--accent); width: 18px; height: 18px; }

/* ---------- каркас ---------- */

.app-shell { display: block; min-height: 100dvh; }
.sidebar { display: none; }
.main {
  min-height: 100dvh;
  padding-bottom: calc(var(--tabbar-h) + var(--safe-b) + 26px);
  display: flex;
  flex-direction: column;
}
.view {
  width: 100%;
  max-width: 1120px;
  margin: 0 auto;
  padding: 4px 16px 8px;
  flex: 1;
  animation: view-in 0.22s ease-out;
}
@keyframes view-in {
  from { opacity: 0; transform: translateY(6px); }
  to { opacity: 1; transform: none; }
}

/* ---------- верхняя панель ---------- */

.topbar {
  position: sticky;
  top: 0;
  z-index: 20;
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 12px;
  padding: 18px 16px 12px;
  max-width: 1120px;
  width: 100%;
  margin: 0 auto;
  background: linear-gradient(180deg, rgba(7, 10, 15, 0.94) 55%, rgba(7, 10, 15, 0));
  backdrop-filter: blur(14px);
}
.topbar h1 { font-size: 26px; font-weight: 700; letter-spacing: -0.03em; }
.topbar__sub { color: var(--muted); font-size: 13px; margin-top: 2px; }
.topbar__actions { display: flex; gap: 8px; align-items: center; padding-bottom: 2px; }

.icon-btn {
  width: 38px; height: 38px;
  display: grid; place-items: center;
  border-radius: 12px;
  border: 1px solid var(--line);
  background: var(--surface);
  cursor: pointer;
  transition: background 0.15s, border-color 0.15s, transform 0.12s;
}
.icon-btn:hover { background: var(--surface-2); border-color: var(--line-2); }
.icon-btn:active { transform: scale(0.96); }
.icon-btn svg { width: 18px; height: 18px; }

/* ---------- нижняя навигация ---------- */

.tabbar {
  position: fixed;
  left: 0; right: 0; bottom: 0;
  z-index: 30;
  height: calc(var(--tabbar-h) + var(--safe-b));
  padding-bottom: var(--safe-b);
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  background: rgba(9, 13, 19, 0.92);
  border-top: 1px solid var(--line);
  backdrop-filter: blur(18px);
}
.tab {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 3px;
  font-size: 10.5px;
  color: var(--dim);
  border: 0;
  background: none;
  cursor: pointer;
  padding: 0;
  transition: color 0.15s;
}
.tab svg { width: 21px; height: 21px; }
.tab.is-active { color: var(--accent); }
.tab.is-active svg { filter: drop-shadow(0 0 10px rgba(94, 234, 212, 0.45)); }
.tab__dot {
  position: absolute; margin-left: 22px; margin-top: -20px;
  width: 6px; height: 6px; border-radius: 50%; background: var(--danger);
}

/* ---------- FAB ---------- */

.fab {
  position: fixed;
  right: 16px;
  bottom: calc(var(--tabbar-h) + var(--safe-b) + 16px);
  z-index: 31;
  width: 56px; height: 56px;
  border-radius: 50%;
  border: 0;
  display: grid; place-items: center;
  background: linear-gradient(140deg, var(--accent), var(--accent-2));
  color: #04120f;
  box-shadow: 0 18px 40px -12px rgba(56, 189, 248, 0.55), 0 0 0 1px rgba(255, 255, 255, 0.18) inset;
  cursor: pointer;
  transition: transform 0.15s, box-shadow 0.2s;
}
.fab:hover { transform: translateY(-2px); }
.fab:active { transform: scale(0.94); }
.fab svg { width: 24px; height: 24px; }
.fab.is-listening { animation: fab-pulse 1.4s infinite; }
@keyframes fab-pulse {
  0%, 100% { box-shadow: 0 0 0 0 rgba(94, 234, 212, 0.5), 0 18px 40px -12px rgba(56, 189, 248, 0.5); }
  50% { box-shadow: 0 0 0 12px rgba(94, 234, 212, 0), 0 18px 40px -12px rgba(56, 189, 248, 0.5); }
}

/* ---------- общие блоки ---------- */

.section { margin: 22px 0 0; }
.section__head {
  display: flex; align-items: baseline; justify-content: space-between;
  gap: 10px; margin-bottom: 10px;
}
.section__title { font-size: 12px; letter-spacing: 0.1em; text-transform: uppercase; color: var(--dim); font-weight: 600; }
.section__hint { font-size: 12.5px; color: var(--dim); }
.section__link { font-size: 12.5px; color: var(--accent); cursor: pointer; background: none; border: 0; padding: 0; }
.section__link:hover { text-decoration: underline; }

.card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 16px;
}
.card--flat { background: transparent; }
.card--pad-lg { padding: 20px; }
.card__head { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 10px; }
.card__title { font-size: 15.5px; font-weight: 600; letter-spacing: -0.01em; }
.card__sub { font-size: 12.5px; color: var(--muted); margin-top: 2px; }

.stack { display: flex; flex-direction: column; gap: 10px; }
.stack--sm { gap: 6px; }
.row-flex { display: flex; align-items: center; gap: 10px; }
.spacer { flex: 1; }
.muted { color: var(--muted); }
.dim { color: var(--dim); }
.small { font-size: 12.5px; }
.tiny { font-size: 11.5px; }
.mono { font-variant-numeric: tabular-nums; font-feature-settings: "tnum"; }
.strike { text-decoration: line-through; color: var(--dim); }

/* ---------- кнопки ---------- */

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  height: 38px; padding: 0 15px;
  border-radius: 11px;
  border: 1px solid var(--line-2);
  background: var(--surface-2);
  color: var(--text);
  font-size: 13.5px; font-weight: 550;
  cursor: pointer;
  white-space: nowrap;
  transition: background 0.15s, border-color 0.15s, transform 0.12s;
}
.btn:hover { background: var(--surface-3); }
.btn:active { transform: scale(0.97); }
.btn svg { width: 15px; height: 15px; }
.btn--primary {
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  color: #04120f; border-color: transparent; font-weight: 650;
}
.btn--primary:hover { filter: brightness(1.06); background: linear-gradient(135deg, var(--accent), var(--accent-2)); }
.btn--ghost { background: transparent; border-color: var(--line); }
.btn--ghost:hover { background: var(--surface); }
.btn--danger { color: var(--danger); border-color: rgba(251, 113, 133, 0.3); background: rgba(251, 113, 133, 0.08); }
.btn--danger:hover { background: rgba(251, 113, 133, 0.16); }
.btn--sm { height: 31px; padding: 0 11px; font-size: 12.5px; border-radius: 9px; }
.btn--block { width: 100%; }
.btn:disabled { opacity: 0.45; cursor: not-allowed; }
.btn-group { display: flex; flex-wrap: wrap; gap: 6px; }

/* ---------- чипы и бейджи ---------- */

.chips { display: flex; gap: 7px; overflow-x: auto; padding: 2px 0 4px; scrollbar-width: none; }
.chips::-webkit-scrollbar { display: none; }
.chip {
  display: inline-flex; align-items: center; gap: 6px;
  height: 30px; padding: 0 12px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: var(--surface);
  color: var(--muted);
  font-size: 12.5px;
  cursor: pointer;
  white-space: nowrap;
  transition: all 0.15s;
}
.chip:hover { background: var(--surface-2); color: var(--text); }
.chip.is-active {
  background: rgba(94, 234, 212, 0.14);
  border-color: rgba(94, 234, 212, 0.4);
  color: var(--accent);
}
.chip__ico { font-size: 13px; }

.badge {
  display: inline-flex; align-items: center; gap: 5px;
  height: 22px; padding: 0 8px;
  border-radius: 7px;
  font-size: 11px; font-weight: 600;
  letter-spacing: 0.01em;
  border: 1px solid transparent;
  white-space: nowrap;
}
.badge--danger { color: #ffc2cb; background: rgba(251, 113, 133, 0.14); border-color: rgba(251, 113, 133, 0.25); }
.badge--warn { color: #ffe3a3; background: rgba(251, 191, 36, 0.13); border-color: rgba(251, 191, 36, 0.24); }
.badge--ok { color: #b5f5d8; background: rgba(52, 211, 153, 0.13); border-color: rgba(52, 211, 153, 0.22); }
.badge--info { color: #bfe8ff; background: rgba(56, 189, 248, 0.13); border-color: rgba(56, 189, 248, 0.22); }
.badge--violet { color: #ddd0ff; background: rgba(167, 139, 250, 0.14); border-color: rgba(167, 139, 250, 0.24); }
.badge--muted { color: var(--muted); background: var(--surface-2); border-color: var(--line); }
.badge--hot { color: #ffd0a8; background: rgba(251, 146, 60, 0.15); border-color: rgba(251, 146, 60, 0.26); }

/* ---------- список строк ---------- */

.list { display: flex; flex-direction: column; gap: 7px; }
.row {
  display: flex;
  align-items: flex-start;
  gap: 11px;
  width: 100%;
  padding: 12px 13px;
  text-align: left;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 14px;
  cursor: pointer;
  transition: background 0.14s, border-color 0.14s, transform 0.12s;
}
.row:hover { background: var(--surface-2); border-color: var(--line-2); }
.row:active { transform: scale(0.995); }
.row__body { flex: 1; min-width: 0; }
.row__title { font-size: 14.5px; font-weight: 550; line-height: 1.35; overflow-wrap: anywhere; }
.row__meta {
  display: flex; flex-wrap: wrap; align-items: center; gap: 4px 8px;
  margin-top: 5px; font-size: 11.5px; color: var(--dim);
}
.row__meta .dot::before { content: "·"; margin-right: 4px; }
.row--done .row__title { text-decoration: line-through; color: var(--dim); font-weight: 450; }
.row--link { background: transparent; border-color: transparent; padding: 9px 10px; }
.row--link:hover { background: var(--surface); }

.check {
  flex: 0 0 auto;
  width: 21px; height: 21px;
  margin-top: 1px;
  border-radius: 50%;
  border: 1.5px solid var(--line-2);
  background: transparent;
  display: grid; place-items: center;
  cursor: pointer;
  transition: all 0.15s;
}
.check:hover { border-color: var(--accent); background: rgba(94, 234, 212, 0.1); }
.check svg { width: 12px; height: 12px; opacity: 0; color: #04120f; }
.check.is-checked { background: var(--ok); border-color: var(--ok); }
.check.is-checked svg { opacity: 1; }
.check--done { background: var(--ok); border-color: var(--ok); }
.check--done svg { opacity: 1; color: #04120f; }

.score {
  flex: 0 0 auto;
  min-width: 34px;
  height: 26px;
  padding: 0 7px;
  border-radius: 8px;
  display: inline-grid;
  place-items: center;
  font-size: 11.5px;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  border: 1px solid var(--line);
  background: var(--surface-2);
  color: var(--muted);
}
.score--hi { color: #b9fbe8; background: rgba(94, 234, 212, 0.12); border-color: rgba(94, 234, 212, 0.3); }
.score--mid { color: #ffe1a8; background: rgba(251, 191, 36, 0.1); border-color: rgba(251, 191, 36, 0.24); }
.score--low { color: var(--dim); }

.ico { flex: 0 0 auto; display: inline-grid; place-items: center; font-size: 14px; line-height: 1; }
.sr-only {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}

/* ---------- Сегодня ---------- */

.hello { padding: 2px 0 12px; }
.hello__title { font-size: 22px; font-weight: 700; letter-spacing: -0.03em; }
.hello__sub { color: var(--muted); font-size: 13.5px; margin-top: 3px; }

.ask-card {
  display: flex; align-items: center; gap: 12px;
  width: 100%;
  padding: 14px 15px;
  border-radius: var(--radius);
  border: 1px solid rgba(94, 234, 212, 0.22);
  background:
    radial-gradient(120% 140% at 0% 0%, rgba(94, 234, 212, 0.13), transparent 60%),
    var(--surface);
  cursor: pointer;
  text-align: left;
  transition: border-color 0.15s, transform 0.12s;
}
.ask-card:hover { border-color: rgba(94, 234, 212, 0.45); }
.ask-card:active { transform: scale(0.995); }
.ask-card__burst {
  width: 38px; height: 38px; border-radius: 12px;
  display: grid; place-items: center;
  background: linear-gradient(140deg, rgba(94, 234, 212, 0.9), rgba(56, 189, 248, 0.9));
  color: #04120f;
  flex: 0 0 auto;
}
.ask-card__burst svg { width: 19px; height: 19px; }
.ask-card__text { font-size: 14px; font-weight: 550; }
.ask-card__hint { font-size: 12px; color: var(--dim); margin-top: 2px; }

.hero {
  position: relative;
  overflow: hidden;
  border-radius: 22px;
  padding: 20px;
  border: 1px solid rgba(94, 234, 212, 0.2);
  background:
    radial-gradient(130% 150% at 100% 0%, rgba(56, 189, 248, 0.16), transparent 55%),
    radial-gradient(90% 120% at 0% 100%, rgba(94, 234, 212, 0.12), transparent 60%),
    rgba(255, 255, 255, 0.03);
}
.hero__eyebrow { font-size: 11px; letter-spacing: 0.12em; text-transform: uppercase; color: var(--accent); font-weight: 650; }
.hero__task { font-size: 21px; font-weight: 680; letter-spacing: -0.02em; margin: 8px 0 4px; line-height: 1.25; }
.hero__reason { font-size: 13px; color: var(--muted); }
.hero__meta { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 12px; }
.hero__actions { display: flex; gap: 8px; margin-top: 16px; }

.quick-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 8px; }
.quick-btn {
  display: flex; align-items: center; gap: 9px;
  padding: 12px;
  border-radius: 14px;
  border: 1px solid var(--line);
  background: var(--surface);
  font-size: 13px;
  cursor: pointer;
  text-align: left;
  transition: background 0.15s, border-color 0.15s;
}
.quick-btn:hover { background: var(--surface-2); border-color: var(--line-2); }
.quick-btn__ico { font-size: 16px; }

/* ---------- метрики ---------- */

.stat-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 8px; }
.stat {
  padding: 13px 14px;
  border-radius: 14px;
  border: 1px solid var(--line);
  background: var(--surface);
}
.stat__value { font-size: 24px; font-weight: 700; letter-spacing: -0.03em; font-variant-numeric: tabular-nums; }
.stat__label { font-size: 11.5px; color: var(--dim); margin-top: 1px; }
.stat--danger .stat__value { color: var(--danger); }
.stat--warn .stat__value { color: var(--warn); }
.stat--ok .stat__value { color: var(--ok); }
.stat--accent .stat__value { color: var(--accent); }

.progress {
  height: 6px; border-radius: 99px; background: var(--surface-2); overflow: hidden;
}
.progress__fill {
  height: 100%; border-radius: 99px;
  background: linear-gradient(90deg, var(--accent), var(--accent-2));
}
.progress__fill--violet { background: linear-gradient(90deg, var(--violet), var(--accent-2)); }

.bars { display: flex; flex-direction: column; gap: 9px; }
.bar__head { display: flex; justify-content: space-between; font-size: 12.5px; margin-bottom: 4px; }
.bar__head b { font-weight: 600; }
.bar__track { height: 7px; border-radius: 99px; background: var(--surface-2); overflow: hidden; }
.bar__fill { height: 100%; border-radius: 99px; background: linear-gradient(90deg, rgba(94, 234, 212, 0.85), rgba(56, 189, 248, 0.85)); }
.bar__fill--violet { background: linear-gradient(90deg, rgba(167, 139, 250, 0.9), rgba(56, 189, 248, 0.7)); }
.bar__fill--warn { background: linear-gradient(90deg, rgba(251, 191, 36, 0.9), rgba(251, 146, 60, 0.8)); }
.bar__fill--danger { background: linear-gradient(90deg, rgba(251, 113, 133, 0.9), rgba(192, 38, 211, 0.6)); }

/* ---------- паузы ---------- */

.pause {
  border-radius: var(--radius);
  border: 1px solid var(--line);
  background: var(--surface);
  padding: 14px;
}
.pause--expired { border-color: rgba(251, 113, 133, 0.24); background: rgba(251, 113, 133, 0.05); }
.pause--undated { border-color: rgba(251, 191, 36, 0.22); background: rgba(251, 191, 36, 0.04); }
.pause--ending { border-color: rgba(56, 189, 248, 0.22); background: rgba(56, 189, 248, 0.04); }
.pause__head { display: flex; align-items: flex-start; justify-content: space-between; gap: 10px; }
.pause__title { font-size: 14.5px; font-weight: 550; }
.pause__reason { font-size: 12px; color: var(--muted); margin-top: 3px; }
.pause__actions { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 11px; }

/* ---------- проекты / области ---------- */

.project-card {
  border-radius: var(--radius);
  border: 1px solid var(--line);
  background: var(--surface);
  overflow: hidden;
}
.project-card__head {
  display: flex; align-items: flex-start; gap: 11px; width: 100%;
  padding: 14px; background: none; border: 0; cursor: pointer; text-align: left;
}
.project-card__head:hover { background: var(--surface-2); }
.project-card__name { font-size: 14.5px; font-weight: 600; }
.project-card__meta { font-size: 11.5px; color: var(--dim); margin-top: 3px; display: flex; flex-wrap: wrap; gap: 4px 9px; }
.project-card__body { padding: 0 14px 14px; }
.project-card__next {
  font-size: 12.5px; color: var(--muted);
  padding: 10px 12px; border-radius: 11px;
  background: rgba(94, 234, 212, 0.06);
  border: 1px solid rgba(94, 234, 212, 0.14);
}
.project-card__next b { color: var(--text); font-weight: 550; }

.dot-pill {
  display: inline-block; width: 8px; height: 8px; border-radius: 50%;
  background: var(--accent); margin-right: 6px; vertical-align: middle;
}

/* ---------- календарь ---------- */

.week {
  display: grid; grid-template-columns: repeat(7, 1fr); gap: 5px;
}
.week__day {
  padding: 9px 2px 8px;
  border-radius: 12px;
  border: 1px solid var(--line);
  background: var(--surface);
  text-align: center;
  cursor: pointer;
  transition: all 0.15s;
}
.week__day:hover { background: var(--surface-2); }
.week__day.is-active { border-color: rgba(94, 234, 212, 0.5); background: rgba(94, 234, 212, 0.12); }
.week__dow { font-size: 10px; color: var(--dim); text-transform: uppercase; letter-spacing: 0.06em; }
.week__num { font-size: 16px; font-weight: 650; margin-top: 2px; }
.week__dot { width: 4px; height: 4px; border-radius: 50%; background: var(--accent); margin: 4px auto 0; }
.week__dot--empty { background: transparent; }

.timeline { display: flex; flex-direction: column; gap: 5px; }
.slot {
  display: flex; gap: 12px; padding: 8px 10px 8px 0;
  border-bottom: 1px solid var(--line);
  font-size: 13px;
}
.slot:last-child { border-bottom: 0; }
.slot__time { flex: 0 0 46px; color: var(--dim); font-size: 11.5px; font-variant-numeric: tabular-nums; padding-top: 2px; }
.slot__body { flex: 1; min-width: 0; }
.slot--plan { background: rgba(94, 234, 212, 0.05); border-radius: 10px; padding: 9px 10px; border-bottom: 0; margin-bottom: 4px; }

/* ---------- ассистент ---------- */

.chat-wrap { display: flex; flex-direction: column; gap: 12px; }
.msg { display: flex; gap: 9px; max-width: 100%; }
.msg--user { flex-direction: row-reverse; }
.msg__avatar {
  flex: 0 0 auto; width: 28px; height: 28px; border-radius: 9px;
  display: grid; place-items: center; font-size: 13px;
  background: linear-gradient(140deg, var(--accent), var(--accent-2)); color: #04120f;
}
.msg--user .msg__avatar { background: var(--surface-3); color: var(--text); }
.msg__body { max-width: 86%; }
.msg__bubble {
  padding: 12px 14px;
  border-radius: 16px;
  background: var(--surface);
  border: 1px solid var(--line);
  font-size: 14px;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}
.msg--user .msg__bubble {
  background: linear-gradient(135deg, rgba(94, 234, 212, 0.16), rgba(56, 189, 248, 0.14));
  border-color: rgba(94, 234, 212, 0.24);
  border-bottom-right-radius: 6px;
}
.msg--bot .msg__bubble { border-bottom-left-radius: 6px; }
.msg__meta { font-size: 10.5px; color: var(--dim); margin-top: 5px; display: flex; gap: 8px; }
.msg__actions { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; }

.suggest-card {
  display: flex; gap: 10px; align-items: flex-start;
  padding: 11px 12px;
  border-radius: 13px;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.025);
  cursor: pointer;
  text-align: left;
  width: 100%;
}
.suggest-card:hover { background: var(--surface-2); }
.suggest-card__title { font-size: 13.5px; font-weight: 550; }
.suggest-card__reason { font-size: 11.5px; color: var(--muted); margin-top: 2px; }

.composer {
  position: sticky;
  bottom: calc(var(--tabbar-h) + var(--safe-b) + 8px);
  z-index: 12;
  display: flex; gap: 8px; align-items: flex-end;
  padding: 9px;
  border-radius: 16px;
  border: 1px solid var(--line-2);
  background: rgba(12, 17, 24, 0.94);
  backdrop-filter: blur(16px);
  box-shadow: var(--shadow);
}
.composer .textarea {
  min-height: 40px; max-height: 132px; resize: none;
  border: 0; background: transparent; padding: 9px 6px;
}
.composer .textarea:focus { box-shadow: none; }
.composer__mic {
  width: 40px; height: 40px; border-radius: 12px; flex: 0 0 auto;
  display: grid; place-items: center;
  background: var(--surface-2); border: 1px solid var(--line);
  cursor: pointer;
}
.composer__mic.is-listening { background: rgba(251, 113, 133, 0.18); border-color: rgba(251, 113, 133, 0.4); color: var(--danger); animation: mic-pulse 1.2s infinite; }
@keyframes mic-pulse { 50% { opacity: 0.6; } }
.composer__send {
  width: 40px; height: 40px; border-radius: 12px; flex: 0 0 auto;
  display: grid; place-items: center; border: 0;
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  color: #04120f; cursor: pointer;
}
.composer__send:disabled { opacity: 0.4; }

.typing { display: inline-flex; gap: 4px; align-items: center; height: 18px; }
.typing i {
  width: 5px; height: 5px; border-radius: 50%; background: var(--muted);
  animation: typing 1s infinite ease-in-out;
}
.typing i:nth-child(2) { animation-delay: 0.15s; }
.typing i:nth-child(3) { animation-delay: 0.3s; }
@keyframes typing { 0%, 80%, 100% { opacity: 0.25; transform: translateY(0); } 40% { opacity: 1; transform: translateY(-3px); } }

/* ---------- карточка задачи ---------- */

.task-head { padding: 4px 0 14px; }
.task-head__title { font-size: 22px; font-weight: 680; letter-spacing: -0.025em; line-height: 1.25; }
.task-head__path { font-size: 12px; color: var(--dim); margin-bottom: 7px; }
.kv { display: grid; grid-template-columns: 108px 1fr; gap: 9px 12px; font-size: 13px; }
.kv dt { color: var(--dim); font-size: 12px; }
.kv dd { margin: 0; }
.chain { display: flex; flex-direction: column; gap: 5px; }
.chain__step { display: flex; align-items: center; gap: 8px; font-size: 12.5px; }
.chain__arrow { color: var(--dim); }
.history { display: flex; flex-direction: column; gap: 7px; font-size: 12px; color: var(--muted); }

.empty {
  padding: 26px 18px;
  text-align: center;
  border-radius: var(--radius);
  border: 1px dashed var(--line-2);
  background: rgba(255, 255, 255, 0.015);
  color: var(--muted);
  font-size: 13px;
}
.empty__ico { font-size: 24px; margin-bottom: 8px; opacity: 0.8; }

.insight {
  display: flex; gap: 10px;
  padding: 12px 13px;
  border-radius: 13px;
  background: rgba(167, 139, 250, 0.07);
  border: 1px solid rgba(167, 139, 250, 0.16);
  font-size: 13px;
}
.insight__ico { flex: 0 0 auto; }

/* ---------- формы ---------- */

.field { display: flex; flex-direction: column; gap: 6px; }
.field__label { font-size: 12px; color: var(--muted); font-weight: 550; }
.field__hint { font-size: 11.5px; color: var(--dim); }
.input, .textarea, .select {
  width: 100%;
  border-radius: 11px;
  border: 1px solid var(--line-2);
  background: rgba(0, 0, 0, 0.22);
  color: var(--text);
  padding: 10px 12px;
  font: inherit;
  font-size: 13.5px;
  outline: none;
  transition: border-color 0.15s, box-shadow 0.15s;
}
.textarea { min-height: 120px; resize: vertical; line-height: 1.5; }
.input:focus, .textarea:focus, .select:focus {
  border-color: rgba(94, 234, 212, 0.5);
  box-shadow: 0 0 0 3px rgba(94, 234, 212, 0.1);
}
.select { appearance: none; background-image: linear-gradient(45deg, transparent 50%, var(--muted) 50%), linear-gradient(135deg, var(--muted) 50%, transparent 50%); background-position: calc(100% - 16px) 50%, calc(100% - 11px) 50%; background-size: 5px 5px, 5px 5px; background-repeat: no-repeat; padding-right: 32px; }
.form-grid { display: grid; gap: 12px; }
.form-grid--2 { grid-template-columns: 1fr 1fr; }

.switch { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 11px 0; }
.switch + .switch { border-top: 1px solid var(--line); }
.switch__label { font-size: 13.5px; }
.switch__hint { font-size: 11.5px; color: var(--dim); margin-top: 2px; }
.toggle {
  position: relative; width: 42px; height: 24px; flex: 0 0 auto;
  border-radius: 99px; background: var(--surface-3); border: 1px solid var(--line-2);
  cursor: pointer; transition: background 0.2s;
}
.toggle::after {
  content: ""; position: absolute; top: 2px; left: 2px;
  width: 18px; height: 18px; border-radius: 50%; background: #cbd5e1;
  transition: transform 0.2s, background 0.2s;
}
.toggle.is-on { background: rgba(94, 234, 212, 0.85); border-color: transparent; }
.toggle.is-on::after { transform: translateX(18px); background: #04120f; }

/* ---------- модалки, тосты ---------- */

.overlay {
  position: fixed; inset: 0; z-index: 60;
  display: flex; align-items: flex-end; justify-content: center;
  background: rgba(3, 6, 10, 0.66);
  backdrop-filter: blur(4px);
  animation: fade 0.16s ease-out;
}
@keyframes fade { from { opacity: 0; } }
.sheet {
  width: 100%; max-width: 520px;
  background: #0d131b;
  border: 1px solid var(--line-2);
  border-bottom: 0;
  border-radius: 22px 22px 0 0;
  padding: 18px 18px calc(18px + var(--safe-b));
  max-height: 88dvh;
  overflow-y: auto;
  animation: sheet-up 0.22s cubic-bezier(0.16, 1, 0.3, 1);
  box-shadow: var(--shadow);
}
@keyframes sheet-up { from { transform: translateY(24px); opacity: 0.6; } }
.sheet__handle { width: 38px; height: 4px; border-radius: 99px; background: var(--surface-3); margin: 0 auto 14px; }
.sheet__title { font-size: 17px; font-weight: 650; margin-bottom: 4px; letter-spacing: -0.02em; }
.sheet__sub { font-size: 12.5px; color: var(--muted); margin-bottom: 14px; }
.sheet__actions { display: flex; gap: 8px; margin-top: 16px; }
.sheet__actions .btn { flex: 1; }

.toasts {
  position: fixed; left: 50%; transform: translateX(-50%);
  bottom: calc(var(--tabbar-h) + var(--safe-b) + 14px);
  z-index: 80; display: flex; flex-direction: column; gap: 8px;
  width: min(440px, calc(100vw - 28px));
  pointer-events: none;
}
.toast {
  display: flex; align-items: center; gap: 10px;
  padding: 11px 14px;
  border-radius: 13px;
  background: rgba(18, 25, 34, 0.97);
  border: 1px solid var(--line-2);
  box-shadow: var(--shadow);
  font-size: 13px;
  pointer-events: auto;
  animation: toast-in 0.2s ease-out;
}
.toast--error { border-color: rgba(251, 113, 133, 0.4); }
.toast--ok { border-color: rgba(52, 211, 153, 0.35); }
.toast button { margin-left: auto; background: none; border: 0; color: var(--accent); font-weight: 600; cursor: pointer; font-size: 12.5px; }
@keyframes toast-in { from { opacity: 0; transform: translateY(8px); } }

/* ---------- разное ---------- */

.grid-2 { display: grid; gap: 10px; }
.grid-3 { display: grid; gap: 10px; }
.kbd {
  display: inline-block; padding: 1px 5px; border-radius: 5px;
  border: 1px solid var(--line-2); background: var(--surface-2);
  font-size: 11px; font-family: ui-monospace, monospace;
}
.tag-select { display: flex; flex-wrap: wrap; gap: 6px; }
.hr { height: 1px; background: var(--line); margin: 14px 0; border: 0; }
.loading-line {
  height: 3px; border-radius: 99px; overflow: hidden; background: var(--surface-2);
}
.loading-line::after {
  content: ""; display: block; height: 100%; width: 40%;
  background: linear-gradient(90deg, transparent, var(--accent), transparent);
  animation: loading 1.1s infinite;
}
@keyframes loading { from { transform: translateX(-100%); } to { transform: translateX(320%); } }

.boot {
  min-height: 100dvh; display: grid; place-content: center; gap: 12px; text-align: center;
  color: var(--muted);
}
.boot__logo { font-size: 34px; color: var(--accent); animation: boot 1.6s infinite ease-in-out; }
@keyframes boot { 50% { opacity: 0.45; transform: rotate(45deg); } }

.menu-list { display: flex; flex-direction: column; gap: 3px; }
.menu-item {
  display: flex; align-items: center; gap: 12px; width: 100%;
  padding: 13px 12px; border-radius: 12px; border: 0; background: none;
  text-align: left; font-size: 14px; cursor: pointer;
}
.menu-item:hover { background: var(--surface); }
.menu-item__ico { width: 30px; height: 30px; border-radius: 9px; display: grid; place-items: center; background: var(--surface-2); font-size: 15px; }
.menu-item__arrow { margin-left: auto; color: var(--dim); }

/* ---------- планшет и десктоп ---------- */

@media (min-width: 720px) {
  .view { padding: 4px 24px 8px; }
  .topbar { padding: 22px 24px 12px; }
  .stat-grid { grid-template-columns: repeat(4, 1fr); }
  .grid-2 { grid-template-columns: 1fr 1fr; }
  .grid-3 { grid-template-columns: repeat(3, 1fr); }
  .quick-grid { grid-template-columns: repeat(4, 1fr); }
  .overlay { align-items: center; }
  .sheet { border-radius: 22px; border-bottom: 1px solid var(--line-2); margin-bottom: 0; }
  .toasts { bottom: 22px; }
}

@media (min-width: 980px) {
  :root { --tabbar-h: 0px; }
  .app-shell { display: grid; grid-template-columns: 250px minmax(0, 1fr); }
  .tabbar { display: none; }
  .fab { right: 28px; bottom: 28px; width: 58px; height: 58px; }
  .main { padding-bottom: 40px; }
  .sidebar {
    display: flex; flex-direction: column;
    position: sticky; top: 0; height: 100dvh;
    padding: 20px 14px;
    border-right: 1px solid var(--line);
    background: rgba(8, 12, 18, 0.6);
    backdrop-filter: blur(12px);
  }
  .brand { display: flex; align-items: center; gap: 10px; padding: 4px 8px 20px; }
  .brand__mark {
    width: 34px; height: 34px; border-radius: 11px; display: grid; place-items: center;
    background: linear-gradient(140deg, var(--accent), var(--accent-2));
    color: #04120f; font-size: 17px; font-weight: 700;
  }
  .brand__name { font-size: 14.5px; font-weight: 650; letter-spacing: -0.01em; }
  .brand__sub { font-size: 10.5px; color: var(--dim); }
  .side-nav { display: flex; flex-direction: column; gap: 2px; overflow-y: auto; }
  .nav-item {
    display: flex; align-items: center; gap: 10px;
    padding: 9px 10px; border-radius: 10px;
    color: var(--muted); font-size: 13.5px;
    transition: background 0.14s, color 0.14s;
  }
  .nav-item:hover { background: var(--surface); color: var(--text); }
  .nav-item.is-active { background: rgba(94, 234, 212, 0.1); color: var(--accent); }
  .nav-item svg { width: 17px; height: 17px; opacity: 0.85; }
  .nav-count {
    margin-left: auto; font-size: 10.5px; font-weight: 650;
    min-width: 19px; height: 19px; border-radius: 6px; display: grid; place-items: center;
    background: var(--surface-2); color: var(--muted); padding: 0 5px;
  }
  .nav-item.is-active .nav-count { background: rgba(94, 234, 212, 0.18); color: var(--accent); }
  .side-foot { margin-top: auto; padding-top: 16px; }
  .side-hint {
    font-size: 11px; color: var(--dim); line-height: 1.5;
    padding: 10px; border-radius: 10px; border: 1px dashed var(--line-2);
  }
  .side-hint b { color: var(--muted); font-weight: 600; }
  .topbar h1 { font-size: 28px; }
  .chat-wrap { max-width: 760px; }
  .composer { bottom: 16px; }
}

@media (min-width: 1280px) {
  .app-shell { grid-template-columns: 264px minmax(0, 1fr); }
  .view { padding: 4px 32px 12px; }
  .topbar { padding: 26px 32px 12px; }
}

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

/* очень узкие экраны (320–360 px) */
@media (max-width: 380px) {
  .topbar { padding: 14px 12px 10px; gap: 8px; }
  .topbar h1 { font-size: 22px; }
  .topbar__sub { font-size: 11.5px; }
  .topbar__actions { gap: 5px; }
  .icon-btn { width: 34px; height: 34px; border-radius: 10px; }
  .view { padding: 4px 12px 8px; }
  .hello__title { font-size: 19px; }
  .hero { padding: 16px; }
  .hero__task { font-size: 18px; }
  .task-head__title { font-size: 19px; }
  .kv { grid-template-columns: 92px 1fr; gap: 8px 10px; }
  .stat__value { font-size: 21px; }
  .btn { padding: 0 11px; font-size: 12.5px; }
  .msg__body { max-width: 92%; }
}

@media print {
  .sidebar, .tabbar, .fab, .topbar__actions { display: none !important; }
  body { background: #fff; color: #000; }
}
