/* ==========================================================================
   AMO Mobile — дизайн-система
   ========================================================================== */
@font-face {
  font-family: "Inter";
  font-style: normal;
  font-weight: 400 800;
  font-display: swap;
  src: url("/fonts/cyrillic.woff2") format("woff2");
  unicode-range: U+0301, U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116;
}
@font-face {
  font-family: "Inter";
  font-style: normal;
  font-weight: 400 800;
  font-display: swap;
  src: url("/fonts/latin.woff2") format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

@font-face {
  font-family: "Inter";
  font-style: normal;
  font-weight: 400 800;
  font-display: swap;
  src: url("/fonts/cyrillic.woff2") format("woff2");
  unicode-range: U+20BD, U+20B4, U+20AC, U+2116;
}

:root {
  --brand: #4e5bf2;
  --brand-2: #7c5cff;
  --brand-soft: rgba(78, 91, 242, 0.09);
  --brand-grad: linear-gradient(135deg, #5266ff 0%, #7b5cff 60%, #9a5cff 100%);

  --bg: #f3f4f9;
  --bg-2: #eceef6;
  --surface: #ffffff;
  --surface-2: #f7f8fc;
  --surface-3: #eef0f8;
  --ink: #111320;
  --ink-2: #3d4358;
  --muted: #767d93;
  --muted-2: #9aa1b4;
  --line: rgba(17, 19, 32, 0.07);
  --line-strong: rgba(17, 19, 32, 0.12);

  --green: #12a150;
  --green-soft: rgba(18, 161, 80, 0.1);
  --red: #e5484d;
  --red-soft: rgba(229, 72, 77, 0.1);
  --amber: #f08c00;
  --amber-soft: rgba(240, 140, 0, 0.12);

  --shadow-s: 0 1px 2px rgba(17, 19, 32, 0.05);
  --shadow-m: 0 2px 6px rgba(17, 19, 32, 0.04), 0 12px 28px -18px rgba(17, 19, 32, 0.25);
  --shadow-l: 0 24px 60px -24px rgba(17, 19, 32, 0.35);

  --r-lg: 24px;
  --r-md: 18px;
  --r-sm: 13px;
  --gutter: 16px;
  --tabbar-h: 68px;
  --ease: cubic-bezier(0.22, 0.8, 0.24, 1);
  --font: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0a0c12;
    --bg-2: #0f121a;
    --surface: #14171f;
    --surface-2: #191d27;
    --surface-3: #20242f;
    --ink: #f1f3f9;
    --ink-2: #c6cbd8;
    --muted: #8d95a8;
    --muted-2: #6b7385;
    --line: rgba(255, 255, 255, 0.07);
    --line-strong: rgba(255, 255, 255, 0.13);
    --brand-soft: rgba(124, 140, 255, 0.16);
    --green-soft: rgba(45, 190, 110, 0.14);
    --red-soft: rgba(255, 100, 105, 0.15);
    --amber-soft: rgba(255, 168, 46, 0.15);
    --shadow-m: 0 2px 10px rgba(0, 0, 0, 0.3);
    --shadow-l: 0 30px 60px -20px rgba(0, 0, 0, 0.6);
  }
}

html[data-theme="dark"] {
  --bg: #0a0c12;
  --bg-2: #0f121a;
  --surface: #14171f;
  --surface-2: #191d27;
  --surface-3: #20242f;
  --ink: #f1f3f9;
  --ink-2: #c6cbd8;
  --muted: #8d95a8;
  --muted-2: #6b7385;
  --line: rgba(255, 255, 255, 0.07);
  --line-strong: rgba(255, 255, 255, 0.13);
  --brand-soft: rgba(124, 140, 255, 0.16);
  --green-soft: rgba(45, 190, 110, 0.14);
  --red-soft: rgba(255, 100, 105, 0.15);
  --amber-soft: rgba(255, 168, 46, 0.15);
  --shadow-m: 0 2px 10px rgba(0, 0, 0, 0.3);
  --shadow-l: 0 30px 60px -20px rgba(0, 0, 0, 0.6);
  color-scheme: dark;
}

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { height: 100%; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body {
  margin: 0;
  font-family: var(--font);
  background: var(--bg);
  color: var(--ink);
  font-size: 15px;
  line-height: 1.45;
  overscroll-behavior-y: none;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}
body.no-scroll { overflow: hidden; }
a { color: inherit; text-decoration: none; }
button, input, textarea, select { font: inherit; color: inherit; }
button { border: 0; background: none; padding: 0; cursor: pointer; }
h1, h2, h3, h4, p { margin: 0; }
::selection { background: rgba(124, 92, 255, 0.25); }

/* ---------- каркас ---------- */
#app { min-height: 100%; }
.view {
  padding: 0 var(--gutter) calc(var(--tabbar-h) + 110px + env(safe-area-inset-bottom));
  max-width: 760px;
  margin: 0 auto;
  animation: view-in 0.28s var(--ease);
}
@keyframes view-in {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: none; }
}
.view.no-tabbar { padding-bottom: calc(96px + env(safe-area-inset-bottom)); }
.view.flush { padding-left: 0; padding-right: 0; }

.topbar {
  position: sticky;
  top: 0;
  z-index: 30;
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 62px;
  padding: calc(8px + env(safe-area-inset-top)) 0 8px;
  background: color-mix(in srgb, var(--bg) 88%, transparent);
  backdrop-filter: blur(18px) saturate(150%);
  -webkit-backdrop-filter: blur(18px) saturate(150%);
  margin: 0 calc(var(--gutter) * -1);
  padding-left: var(--gutter);
  padding-right: var(--gutter);
}
.topbar.plain { background: transparent; backdrop-filter: none; }
.topbar-title {
  font-size: 26px;
  font-weight: 800;
  letter-spacing: -0.035em;
  line-height: 1.1;
  flex: 1;
  min-width: 0;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.topbar-sub { color: var(--muted); font-size: 13px; margin-top: 2px; font-weight: 500; }
.icon-btn {
  width: 42px;
  height: 42px;
  flex: 0 0 42px;
  border-radius: 14px;
  display: grid;
  place-items: center;
  color: var(--ink);
  background: var(--surface);
  box-shadow: var(--shadow-s);
  border: 1px solid var(--line);
  transition: transform 0.15s var(--ease), background 0.2s;
}
.icon-btn:active { transform: scale(0.94); }
.icon-btn.ghost { background: transparent; border-color: transparent; box-shadow: none; }
.icon-btn.accent { background: var(--brand-soft); color: var(--brand); border-color: transparent; }
.icon-btn svg { width: 21px; height: 21px; }
svg.ic { width: 22px; height: 22px; stroke: currentColor; fill: none; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; flex: none; display: block; }
svg.ic.sm { width: 18px; height: 18px; }
svg.ic.xs { width: 15px; height: 15px; stroke-width: 2; }

/* ---------- нижняя навигация ---------- */
.tabbar {
  position: fixed;
  z-index: 40;
  left: 50%;
  transform: translateX(-50%);
  bottom: calc(10px + env(safe-area-inset-bottom));
  width: min(calc(100% - 24px), 460px);
  height: var(--tabbar-h);
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  align-items: center;
  padding: 0 6px;
  border-radius: 26px;
  background: color-mix(in srgb, var(--surface) 82%, transparent);
  backdrop-filter: blur(22px) saturate(180%);
  -webkit-backdrop-filter: blur(22px) saturate(180%);
  border: 1px solid var(--line);
  box-shadow: 0 18px 40px -18px rgba(17, 19, 32, 0.45), 0 2px 8px rgba(17, 19, 32, 0.06);
  transition: transform 0.3s var(--ease), opacity 0.2s;
}
.tabbar[hidden] { display: none; }
.tab {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 3px;
  color: var(--muted-2);
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.01em;
  padding: 8px 0;
  border-radius: 18px;
  transition: color 0.2s, transform 0.15s var(--ease);
  position: relative;
}
.tab svg { width: 23px; height: 23px; stroke-width: 1.85; }
.tab:active { transform: scale(0.93); }
.tab.active { color: var(--brand); }
.tab.active svg { stroke-width: 2.1; }
.tab.active::after {
  content: "";
  position: absolute;
  bottom: 1px;
  width: 4px;
  height: 4px;
  border-radius: 50%;
  background: var(--brand);
}
.tab-fab {
  width: 54px;
  height: 54px;
  margin: -26px auto 0;
  border-radius: 19px;
  background: var(--brand-grad);
  color: #fff;
  display: grid;
  place-items: center;
  box-shadow: 0 12px 24px -10px rgba(78, 91, 242, 0.9), inset 0 1px 0 rgba(255, 255, 255, 0.35);
  transition: transform 0.18s var(--ease);
  border: 3px solid var(--bg);
}
.tab-fab:active { transform: scale(0.93) rotate(90deg); }
.tab-fab svg { width: 26px; height: 26px; stroke-width: 2.2; }

/* ---------- типографика / утилиты ---------- */
.h1 { font-size: 28px; font-weight: 800; letter-spacing: -0.04em; line-height: 1.15; }
.h2 { font-size: 19px; font-weight: 750; letter-spacing: -0.025em; }
.muted { color: var(--muted); }
.small { font-size: 13px; }
.tiny { font-size: 12px; }
.nums { font-variant-numeric: tabular-nums; letter-spacing: -0.02em; }
.row { display: flex; align-items: center; gap: 10px; }
.spacer { flex: 1; }
.stack { display: flex; flex-direction: column; gap: 10px; }
.section { margin-top: 26px; }
.section-head { display: flex; align-items: baseline; gap: 8px; margin: 0 2px 12px; }
.section-head h2 { font-size: 17px; font-weight: 750; letter-spacing: -0.02em; }
.section-head .link { margin-left: auto; color: var(--brand); font-size: 13px; font-weight: 650; }
.card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r-md);
  box-shadow: var(--shadow-s);
}
.pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  height: 26px;
  padding: 0 10px;
  border-radius: 999px;
  background: var(--surface-3);
  color: var(--ink-2);
  font-size: 12px;
  font-weight: 650;
  white-space: nowrap;
}
.pill .dot { width: 7px; height: 7px; border-radius: 50%; background: currentColor; }
.pill.brand { background: var(--brand-soft); color: var(--brand); }
.pill.green { background: var(--green-soft); color: var(--green); }
.pill.red { background: var(--red-soft); color: var(--red); }
.pill.amber { background: var(--amber-soft); color: var(--amber); }

.avatar {
  width: 44px;
  height: 44px;
  flex: 0 0 44px;
  border-radius: 15px;
  display: grid;
  place-items: center;
  color: #fff;
  font-weight: 700;
  font-size: 15px;
  letter-spacing: -0.02em;
  background: linear-gradient(135deg, #6b7bff, #9a6bff);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.25);
  overflow: hidden;
}
.avatar.round { border-radius: 50%; }
.avatar.sm { width: 32px; height: 32px; flex-basis: 32px; border-radius: 11px; font-size: 12px; }
.avatar.lg { width: 64px; height: 64px; flex-basis: 64px; border-radius: 22px; font-size: 21px; }
.av-0 { background: linear-gradient(135deg, #6477ff, #9a6bff); }
.av-1 { background: linear-gradient(135deg, #17b8a6, #35d07f); }
.av-2 { background: linear-gradient(135deg, #ff8a5c, #ff5f7e); }
.av-3 { background: linear-gradient(135deg, #38a3ff, #5f7cff); }
.av-4 { background: linear-gradient(135deg, #b06bff, #e26bff); }
.av-5 { background: linear-gradient(135deg, #f2b23c, #f2793c); }

.empty {
  text-align: center;
  padding: 42px 24px;
  color: var(--muted);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
}
.empty .emoji { font-size: 34px; filter: grayscale(0.1); }
.empty b { color: var(--ink); font-weight: 650; display: block; font-size: 15px; }
.empty p { font-size: 13px; max-width: 260px; }

.btn {
  height: 50px;
  border-radius: 15px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 0 20px;
  font-weight: 650;
  font-size: 15px;
  background: var(--surface-3);
  color: var(--ink);
  transition: transform 0.15s var(--ease), opacity 0.2s, background 0.2s;
  width: 100%;
}
.btn:active { transform: scale(0.975); }
.btn.primary {
  background: var(--brand-grad);
  color: #fff;
  box-shadow: 0 10px 24px -12px rgba(78, 91, 242, 0.9);
}
.btn.ghost { background: transparent; color: var(--brand); }
.btn[disabled] { opacity: 0.55; pointer-events: none; }
.btn.sm { height: 40px; font-size: 14px; border-radius: 12px; padding: 0 14px; width: auto; }

/* ---------- скелетоны ---------- */
.sk { background: linear-gradient(100deg, var(--surface-2) 20%, var(--surface-3) 38%, var(--surface-2) 56%); background-size: 200% 100%; animation: shimmer 1.4s infinite linear; border-radius: 10px; }
@keyframes shimmer { to { background-position: -200% 0; } }
.sk-card { height: 76px; border-radius: var(--r-md); margin-bottom: 10px; }
.sk-line { height: 12px; margin-bottom: 8px; }

/* ---------- лист снизу ---------- */
.sheet-backdrop {
  position: fixed;
  inset: 0;
  z-index: 80;
  background: rgba(9, 11, 20, 0.45);
  backdrop-filter: blur(3px);
  opacity: 0;
  transition: opacity 0.22s var(--ease);
}
.sheet-backdrop.show { opacity: 1; }
.sheet {
  position: fixed;
  z-index: 81;
  left: 0;
  right: 0;
  bottom: 0;
  margin: 0 auto;
  max-width: 560px;
  background: var(--surface);
  border-radius: 26px 26px 0 0;
  padding: 8px 18px calc(18px + env(safe-area-inset-bottom));
  transform: translateY(102%);
  transition: transform 0.32s var(--ease);
  box-shadow: var(--shadow-l);
  max-height: 88vh;
  overflow-y: auto;
  overscroll-behavior: contain;
}
.sheet.show { transform: none; }
.sheet.wide { max-width: 640px; }
.sheet-grip { width: 40px; height: 5px; border-radius: 3px; background: var(--line-strong); margin: 4px auto 12px; }
.sheet h3 { font-size: 20px; font-weight: 750; letter-spacing: -0.03em; margin-bottom: 4px; }
.sheet .sheet-sub { color: var(--muted); font-size: 13px; margin-bottom: 16px; }
.sheet-actions { display: flex; flex-direction: column; gap: 6px; margin-top: 8px; }
.sheet-action {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 14px 12px;
  border-radius: 15px;
  text-align: left;
  font-weight: 600;
  font-size: 15px;
  transition: background 0.15s;
  width: 100%;
}
.sheet-action:active { background: var(--surface-2); }
.sheet-action .ico {
  width: 40px;
  height: 40px;
  flex: 0 0 40px;
  border-radius: 13px;
  display: grid;
  place-items: center;
  background: var(--brand-soft);
  color: var(--brand);
}
.sheet-action .ico.green { background: var(--green-soft); color: var(--green); }
.sheet-action .ico.amber { background: var(--amber-soft); color: var(--amber); }
.sheet-action .ico.red { background: var(--red-soft); color: var(--red); }
.sheet-action small { display: block; color: var(--muted); font-weight: 500; font-size: 12px; margin-top: 1px; }
.sheet-close { position: absolute; top: 14px; right: 14px; }

/* формы */
.field { display: flex; flex-direction: column; gap: 7px; margin-bottom: 14px; }
.field label { font-size: 12px; font-weight: 650; color: var(--muted); letter-spacing: 0.02em; text-transform: uppercase; }
.input, .textarea, .select {
  width: 100%;
  height: 52px;
  padding: 0 15px;
  border-radius: 14px;
  border: 1px solid var(--line-strong);
  background: var(--surface-2);
  font-size: 16px;
  outline: none;
  transition: border-color 0.2s, background 0.2s, box-shadow 0.2s;
}
.textarea { height: auto; min-height: 92px; padding: 13px 15px; resize: none; line-height: 1.4; }
.input:focus, .textarea:focus, .select:focus { border-color: var(--brand); background: var(--surface); box-shadow: 0 0 0 4px var(--brand-soft); }
.input::placeholder, .textarea::placeholder { color: var(--muted-2); }
.select { appearance: none; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' fill='none' stroke='%23767d93' stroke-width='2' stroke-linecap='round'%3E%3Cpath d='M4 6l4 4 4-4'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 14px center; padding-right: 38px; }

.switch { position: relative; width: 48px; height: 29px; flex: 0 0 48px; }
.switch input { position: absolute; opacity: 0; width: 100%; height: 100%; margin: 0; cursor: pointer; }
.switch .track { position: absolute; inset: 0; border-radius: 999px; background: var(--surface-3); transition: background 0.2s; }
.switch .track::after { content: ""; position: absolute; top: 3px; left: 3px; width: 23px; height: 23px; border-radius: 50%; background: #fff; box-shadow: 0 1px 3px rgba(0, 0, 0, 0.25); transition: transform 0.22s var(--ease); }
.switch input:checked + .track { background: var(--brand); }
.switch input:checked + .track::after { transform: translateX(19px); }

/* ---------- тосты ---------- */
.toasts {
  position: fixed;
  z-index: 120;
  top: calc(10px + env(safe-area-inset-top));
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  flex-direction: column;
  gap: 8px;
  pointer-events: none;
  width: min(calc(100% - 28px), 420px);
}
.toast {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 16px;
  border-radius: 15px;
  background: color-mix(in srgb, var(--ink) 92%, transparent);
  color: #fff;
  font-size: 14px;
  font-weight: 550;
  box-shadow: 0 12px 30px -12px rgba(0, 0, 0, 0.5);
  animation: toast-in 0.3s var(--ease);
  backdrop-filter: blur(8px);
}
.toast.out { animation: toast-out 0.25s var(--ease) forwards; }
.toast svg { width: 18px; height: 18px; color: #6ee7a8; }
.toast.err svg { color: #ff8d90; }
@keyframes toast-in { from { opacity: 0; transform: translateY(-14px) scale(0.97); } }
@keyframes toast-out { to { opacity: 0; transform: translateY(-10px) scale(0.98); } }

.offline {
  position: fixed;
  z-index: 90;
  left: 50%;
  transform: translateX(-50%);
  bottom: calc(var(--tabbar-h) + 22px + env(safe-area-inset-bottom));
  background: var(--amber);
  color: #241300;
  font-size: 12px;
  font-weight: 650;
  padding: 7px 14px;
  border-radius: 999px;
  box-shadow: 0 8px 20px -8px rgba(0, 0, 0, 0.4);
}

/* ==========================================================================
   Вход
   ========================================================================== */
.login {
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
  padding: calc(30px + env(safe-area-inset-top)) 22px calc(30px + env(safe-area-inset-bottom));
  background:
    radial-gradient(1000px 520px at 100% -10%, rgba(124, 92, 255, 0.16), transparent 60%),
    radial-gradient(800px 460px at -20% 20%, rgba(78, 91, 242, 0.14), transparent 55%),
    var(--bg);
  position: relative;
  overflow: hidden;
}
.login::after {
  content: "";
  position: absolute;
  width: 420px;
  height: 420px;
  right: -180px;
  top: -140px;
  border-radius: 50%;
  background: conic-gradient(from 120deg, #5b66ff, #9a5cff, #5bd6ff, #5b66ff);
  filter: blur(70px);
  opacity: 0.35;
  pointer-events: none;
}
.login-wrap { width: 100%; max-width: 420px; margin: auto; position: relative; z-index: 1; }
.login-logo { display: flex; align-items: center; gap: 12px; margin-bottom: 34px; }
.logo-mark {
  width: 46px;
  height: 46px;
  border-radius: 15px;
  background: var(--brand-grad);
  display: grid;
  place-items: center;
  color: #fff;
  box-shadow: 0 12px 26px -12px rgba(78, 91, 242, 0.95), inset 0 1px 0 rgba(255, 255, 255, 0.3);
  flex: none;
}
.logo-mark svg { width: 26px; height: 26px; stroke-width: 2.6; }
.logo-text { font-weight: 800; font-size: 17px; letter-spacing: -0.03em; line-height: 1.1; }
.logo-text span { display: block; color: var(--muted); font-size: 11px; font-weight: 600; letter-spacing: 0.06em; text-transform: uppercase; margin-top: 3px; }
.login h1 { font-size: 34px; line-height: 1.08; letter-spacing: -0.045em; font-weight: 800; margin-bottom: 12px; }
.login h1 em { font-style: normal; background: var(--brand-grad); -webkit-background-clip: text; background-clip: text; color: transparent; }
.login .lead { color: var(--muted); font-size: 15px; margin-bottom: 26px; max-width: 330px; }
.login-card {
  background: color-mix(in srgb, var(--surface) 88%, transparent);
  border: 1px solid var(--line);
  border-radius: 24px;
  padding: 18px;
  box-shadow: var(--shadow-m);
  backdrop-filter: blur(12px);
}
.login-note { margin-top: 18px; color: var(--muted); font-size: 12.5px; line-height: 1.55; }
.login-note b { color: var(--ink-2); font-weight: 650; }
.login-foot { margin-top: 26px; display: flex; align-items: center; gap: 10px; color: var(--muted-2); font-size: 12px; }
.login-error { color: var(--red); font-size: 13px; margin-top: 4px; display: none; }
.login-error.show { display: block; }
.steps { display: flex; flex-direction: column; gap: 10px; margin-top: 16px; }
.step { display: flex; gap: 10px; font-size: 13px; color: var(--muted); }
.step b { color: var(--ink); }
.step .n { width: 20px; height: 20px; flex: 0 0 20px; border-radius: 7px; background: var(--surface-3); display: grid; place-items: center; font-size: 11px; font-weight: 700; color: var(--ink-2); }
.divider { display: flex; align-items: center; gap: 12px; color: var(--muted-2); font-size: 12px; margin: 16px 0; }
.divider::before, .divider::after { content: ""; height: 1px; background: var(--line); flex: 1; }

/* ==========================================================================
   Главная
   ========================================================================== */
.home-head { display: flex; align-items: center; gap: 12px; padding: calc(14px + env(safe-area-inset-top)) 2px 8px; }
.home-hello .hi { font-size: 13px; color: var(--muted); font-weight: 600; }
.home-hello .name { font-size: 26px; font-weight: 800; letter-spacing: -0.04em; line-height: 1.15; }
.home-head .avatar { margin-left: auto; }
.bell { position: relative; }
.bell .badge { position: absolute; top: 7px; right: 8px; width: 8px; height: 8px; border-radius: 50%; background: var(--red); box-shadow: 0 0 0 2px var(--surface); }

.hero {
  position: relative;
  overflow: hidden;
  border-radius: 26px;
  padding: 20px;
  color: #fff;
  background: linear-gradient(140deg, #2b2f63 0%, #3b3a86 44%, #6a49c9 100%);
  box-shadow: 0 22px 44px -24px rgba(58, 52, 140, 0.75);
  isolation: isolate;
}
.hero::before {
  content: "";
  position: absolute;
  width: 230px;
  height: 230px;
  border-radius: 50%;
  right: -80px;
  top: -110px;
  background: radial-gradient(circle, rgba(255, 255, 255, 0.32), transparent 65%);
  z-index: -1;
}
.hero::after {
  content: "";
  position: absolute;
  inset: 0;
  background-image: linear-gradient(rgba(255, 255, 255, 0.05) 1px, transparent 1px), linear-gradient(90deg, rgba(255, 255, 255, 0.05) 1px, transparent 1px);
  background-size: 26px 26px;
  mask-image: radial-gradient(120% 90% at 80% 0%, #000 20%, transparent 70%);
  z-index: -1;
}
.hero .cap { font-size: 12px; font-weight: 600; letter-spacing: 0.08em; text-transform: uppercase; color: rgba(255, 255, 255, 0.72); }
.hero .sum { font-size: 36px; font-weight: 800; letter-spacing: -0.045em; line-height: 1.05; margin-top: 6px; font-variant-numeric: tabular-nums; }
.hero .sum small { font-size: 18px; font-weight: 650; opacity: 0.8; margin-left: 2px; }
.hero .under { color: rgba(255, 255, 255, 0.74); font-size: 13px; margin-top: 4px; }
.hero .hero-foot { display: flex; gap: 8px; margin-top: 18px; }
.hero .hero-chip { display: flex; align-items: center; gap: 6px; padding: 8px 11px; border-radius: 12px; background: rgba(255, 255, 255, 0.12); font-size: 12px; font-weight: 600; backdrop-filter: blur(6px); }
.hero .hero-chip svg { width: 15px; height: 15px; opacity: 0.9; }

.stat-row { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; margin-top: 12px; }
.stat {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r-md);
  padding: 13px 12px;
  box-shadow: var(--shadow-s);
  display: flex;
  flex-direction: column;
  gap: 3px;
  min-width: 0;
}
.stat .k { font-size: 11.5px; color: var(--muted); font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.stat .v { font-size: 21px; font-weight: 780; letter-spacing: -0.035em; line-height: 1.15; }
.stat .v.red { color: var(--red); }
.stat .v.green { color: var(--green); }

.quick { display: grid; grid-template-columns: repeat(4, 1fr); gap: 9px; }
.quick-btn {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 7px;
  padding: 13px 4px;
  border-radius: var(--r-md);
  background: var(--surface);
  border: 1px solid var(--line);
  box-shadow: var(--shadow-s);
  font-size: 11.5px;
  font-weight: 650;
  color: var(--ink-2);
  transition: transform 0.15s var(--ease);
}
.quick-btn:active { transform: scale(0.95); }
.quick-btn .qi { width: 38px; height: 38px; border-radius: 13px; display: grid; place-items: center; background: var(--brand-soft); color: var(--brand); }
.quick-btn .qi svg { width: 20px; height: 20px; }
.quick-btn:nth-child(2) .qi { background: var(--green-soft); color: var(--green); }
.quick-btn:nth-child(3) .qi { background: var(--amber-soft); color: var(--amber); }
.quick-btn:nth-child(4) .qi { background: rgba(56, 163, 255, 0.12); color: #2f8fe0; }

.task-row {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 13px 14px;
  border-radius: var(--r-md);
  background: var(--surface);
  border: 1px solid var(--line);
  box-shadow: var(--shadow-s);
  position: relative;
  transition: opacity 0.25s, transform 0.25s var(--ease);
}
.task-row + .task-row { margin-top: 8px; }
.task-row.done { opacity: 0.5; }
.task-row.removing { transform: translateX(12px); opacity: 0; }
.check-circle {
  width: 24px;
  height: 24px;
  flex: 0 0 24px;
  border-radius: 50%;
  border: 2px solid var(--line-strong);
  display: grid;
  place-items: center;
  color: transparent;
  margin-top: 1px;
  transition: all 0.2s var(--ease);
}
.check-circle:active { transform: scale(0.9); }
.check-circle svg { width: 14px; height: 14px; stroke-width: 2.6; }
.task-row.done .check-circle { background: var(--green); border-color: var(--green); color: #fff; }
.task-row.overdue .check-circle { border-color: var(--red); }
.check-circle:hover { border-color: var(--brand); }
.task-main { min-width: 0; flex: 1; }
.task-text { font-weight: 600; font-size: 14.5px; line-height: 1.3; }
.task-row.done .task-text { text-decoration: line-through; }
.task-meta { display: flex; align-items: center; gap: 6px; margin-top: 4px; font-size: 12px; color: var(--muted); min-width: 0; }
.task-meta svg { width: 13px; height: 13px; }
.task-meta .deal-name { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.task-time { font-weight: 650; color: var(--ink-2); font-size: 12px; flex: none; }
.task-time.red { color: var(--red); }
.task-time.amber { color: var(--amber); }

/* карточка сделки в списке */
.deal-list { display: flex; flex-direction: column; gap: 8px; }
.deal-row {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px;
  border-radius: var(--r-md);
  background: var(--surface);
  border: 1px solid var(--line);
  box-shadow: var(--shadow-s);
  transition: transform 0.14s var(--ease), background 0.2s;
  position: relative;
  overflow: hidden;
}
.deal-row:active { transform: scale(0.985); background: var(--surface-2); }
.deal-row .main { min-width: 0; flex: 1; }
.deal-row .name { font-weight: 640; font-size: 14.5px; line-height: 1.28; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.deal-row .sub { display: flex; align-items: center; gap: 6px; margin-top: 4px; font-size: 12px; color: var(--muted); min-width: 0; white-space: nowrap; overflow: hidden; }
.deal-row .sub > span { flex: none; }
.deal-row .sub .co { flex: 0 1 auto; min-width: 0; }
.deal-row .sub .co { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.deal-row .sub .sep { width: 3px; height: 3px; border-radius: 50%; background: var(--muted-2); flex: none; }
.deal-row .right { text-align: right; flex: none; display: flex; flex-direction: column; align-items: flex-end; gap: 4px; }
.deal-row .price { font-weight: 720; font-size: 14.5px; letter-spacing: -0.025em; font-variant-numeric: tabular-nums; white-space: nowrap; }
.deal-row .when { font-size: 11px; color: var(--muted-2); white-space: nowrap; }
.stage-dot { width: 7px; height: 7px; border-radius: 50%; flex: none; }

/* ==========================================================================
   Сделки: список / канбан
   ========================================================================== */
.chips-scroll {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  padding: 6px 0 10px;
  margin: 0 calc(var(--gutter) * -1);
  padding-left: var(--gutter);
  padding-right: var(--gutter);
  scrollbar-width: none;
  scroll-snap-type: x proximity;
}
.chips-scroll::-webkit-scrollbar { display: none; }
.chip {
  height: 36px;
  padding: 0 14px;
  border-radius: 12px;
  background: var(--surface);
  border: 1px solid var(--line);
  display: inline-flex;
  align-items: center;
  gap: 7px;
  font-size: 13px;
  font-weight: 650;
  color: var(--ink-2);
  white-space: nowrap;
  flex: none;
  transition: all 0.18s var(--ease);
}
.chip:active { transform: scale(0.96); }
.chip.on { background: var(--brand); color: #fff; border-color: transparent; box-shadow: 0 6px 16px -8px rgba(78, 91, 242, 0.85); }
.chip .n { font-size: 11px; opacity: 0.65; font-weight: 700; }
.chip.on .n { opacity: 0.8; }

.searchbar { display: flex; align-items: center; gap: 9px; margin: 4px 0 12px; }
.searchbar .box { position: relative; flex: 1; }
.searchbar .box svg { position: absolute; left: 13px; top: 50%; transform: translateY(-50%); width: 18px; height: 18px; color: var(--muted-2); }
.searchbar .input { height: 46px; padding-left: 40px; font-size: 15px; border-radius: 14px; }
.searchbar .cancel { color: var(--brand); font-weight: 650; font-size: 14px; padding: 8px 4px; }

.stage-group { margin-bottom: 18px; }
.stage-head {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 0 2px 8px;
  position: sticky;
  top: 62px;
  z-index: 5;
  background: linear-gradient(var(--bg) 72%, transparent);
  padding-top: 6px;
}
.stage-head .name { font-weight: 700; font-size: 13px; letter-spacing: -0.01em; }
.stage-head .count { color: var(--muted-2); font-size: 12px; font-weight: 600; }
.stage-head .sum { margin-left: auto; font-size: 12px; font-weight: 650; color: var(--muted); font-variant-numeric: tabular-nums; }
.stage-head .bar { width: 3px; height: 14px; border-radius: 2px; flex: none; }
.stage-group.collapsed .deal-list { display: none; }
.stage-head .chev { width: 14px; height: 14px; color: var(--muted-2); transition: transform 0.2s; }
.stage-group.collapsed .chev { transform: rotate(-90deg); }

.board {
  display: flex;
  gap: 12px;
  overflow-x: auto;
  overflow-y: hidden;
  padding: 6px 0 20px;
  margin: 0 calc(var(--gutter) * -1);
  padding-left: var(--gutter);
  padding-right: var(--gutter);
  scroll-snap-type: x mandatory;
  align-items: flex-start;
  min-height: 60vh;
  scrollbar-width: none;
}
.board::-webkit-scrollbar { display: none; }
.board-col {
  flex: 0 0 82%;
  max-width: 330px;
  scroll-snap-align: center;
  background: var(--surface-2);
  border: 1px solid var(--line);
  border-radius: 20px;
  padding: 10px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  max-height: calc(100dvh - 210px);
  overflow-y: auto;
}
.board-col-head { display: flex; align-items: center; gap: 7px; padding: 2px 4px 6px; position: sticky; top: -10px; background: var(--surface-2); z-index: 2; }
.board-col-head .name { font-size: 13px; font-weight: 700; }
.board-col-head .sum { margin-left: auto; font-size: 11.5px; color: var(--muted); font-weight: 600; }
.board-card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 15px;
  padding: 11px 12px;
  box-shadow: var(--shadow-s);
  transition: transform 0.14s var(--ease);
}
.board-card:active { transform: scale(0.975); }
.board-card .name { font-size: 13.5px; font-weight: 640; line-height: 1.3; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.board-card .bottom { display: flex; align-items: center; gap: 6px; margin-top: 8px; font-size: 11.5px; color: var(--muted); }
.board-card .price { margin-left: auto; font-weight: 700; color: var(--ink); font-variant-numeric: tabular-nums; }
.board-card .who { display: flex; align-items: center; gap: 5px; min-width: 0; }
.board-empty { color: var(--muted-2); font-size: 12.5px; text-align: center; padding: 22px 8px; }

/* ==========================================================================
   Карточка сделки
   ========================================================================== */
.deal-view { padding-bottom: calc(90px + env(safe-area-inset-bottom)); }
.deal-hero {
  position: relative;
  margin: 0 calc(var(--gutter) * -1);
  padding: calc(10px + env(safe-area-inset-top)) var(--gutter) 24px;
  color: #fff;
  background: #12142a;
  background: linear-gradient(165deg, color-mix(in srgb, var(--stage, #5b6bff) 52%, #12142a) 0%, #12142a 72%);
  border-radius: 0 0 30px 30px;
  overflow: hidden;
}
.deal-hero::after {
  content: "";
  position: absolute;
  inset: 0;
  background: radial-gradient(120% 70% at 90% 0%, rgba(255, 255, 255, 0.16), transparent 60%);
  pointer-events: none;
}
.deal-hero .bar { display: flex; align-items: center; gap: 10px; margin-bottom: 18px; position: relative; z-index: 1; }
.glass-btn {
  width: 40px;
  height: 40px;
  border-radius: 13px;
  background: rgba(255, 255, 255, 0.13);
  border: 1px solid rgba(255, 255, 255, 0.16);
  color: #fff;
  display: grid;
  place-items: center;
  backdrop-filter: blur(10px);
  transition: transform 0.15s var(--ease);
}
.glass-btn:active { transform: scale(0.92); }
.glass-btn svg { width: 20px; height: 20px; }
.deal-hero .stage-pill {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  height: 30px;
  padding: 0 12px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.14);
  border: 1px solid rgba(255, 255, 255, 0.14);
  font-size: 12px;
  font-weight: 650;
  backdrop-filter: blur(10px);
}
.deal-hero .stage-pill .dot { width: 7px; height: 7px; border-radius: 50%; background: var(--stage); box-shadow: 0 0 10px var(--stage); }
.deal-hero .stage-pill svg { width: 13px; height: 13px; opacity: 0.7; }
.deal-hero .name { font-size: 22px; font-weight: 780; letter-spacing: -0.035em; line-height: 1.22; margin: 4px 0 10px; position: relative; z-index: 1; max-width: 92%; }
.deal-hero .price { font-size: 34px; font-weight: 800; letter-spacing: -0.045em; font-variant-numeric: tabular-nums; position: relative; z-index: 1; }
.deal-hero .price small { font-size: 17px; font-weight: 600; opacity: 0.75; margin-left: 3px; }
.deal-hero .meta { display: flex; align-items: center; gap: 8px; margin-top: 10px; color: rgba(255, 255, 255, 0.65); font-size: 12.5px; position: relative; z-index: 1; }
.progress { display: flex; gap: 4px; margin: 18px 0 2px; position: relative; z-index: 1; }
.progress i { height: 4px; flex: 1; border-radius: 2px; background: rgba(255, 255, 255, 0.2); transition: background 0.3s; }
.progress i.on { background: rgba(255, 255, 255, 0.92); }
.progress i.cur { background: #fff; box-shadow: 0 0 12px rgba(255, 255, 255, 0.8); }

.action-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin-top: -16px; position: relative; z-index: 2; }
.action {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 17px;
  padding: 11px 6px 9px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  font-size: 11px;
  font-weight: 650;
  color: var(--ink-2);
  box-shadow: var(--shadow-m);
  transition: transform 0.15s var(--ease);
}
.action:active { transform: scale(0.95); }
.action svg { width: 21px; height: 21px; color: var(--brand); }
.action.green svg { color: var(--green); }
.action.amber svg { color: var(--amber); }
.action.blue svg { color: #2f8fe0; }

.info-card { padding: 14px 15px; margin-top: 14px; }
.info-row { display: flex; align-items: center; gap: 12px; padding: 9px 0; }
.info-row + .info-row { border-top: 1px solid var(--line); }
.info-row .ico { width: 36px; height: 36px; flex: 0 0 36px; border-radius: 12px; display: grid; place-items: center; background: var(--surface-2); color: var(--muted); }
.info-row .ico svg { width: 18px; height: 18px; }
.info-row .txt { min-width: 0; flex: 1; }
.info-row .k { display: block; font-size: 10.5px; color: var(--muted); font-weight: 650; text-transform: uppercase; letter-spacing: 0.045em; line-height: 1.3; }
.info-row .v { display: block; font-weight: 620; font-size: 14px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; margin-top: 2px; }
.info-row a.v { color: var(--brand); }
.info-row .go { color: var(--muted-2); width: 18px; height: 18px; }

.fields-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 1px; background: var(--line); border-radius: var(--r-md); overflow: hidden; margin-top: 14px; border: 1px solid var(--line); }
.field-cell { background: var(--surface); padding: 12px 14px; min-width: 0; }
.field-cell .k { font-size: 11px; color: var(--muted); font-weight: 600; }
.field-cell .v { font-size: 14px; font-weight: 620; margin-top: 3px; word-break: break-word; }
.field-cell:last-child:nth-child(odd) { grid-column: 1 / -1; }

.tabs { display: flex; gap: 4px; padding: 4px; background: var(--surface-3); border-radius: 13px; margin-top: 18px; }
.tab-btn { flex: 1; height: 36px; border-radius: 10px; font-size: 13px; font-weight: 650; color: var(--muted); transition: all 0.2s var(--ease); }
.tab-btn.on { background: var(--surface); color: var(--ink); box-shadow: var(--shadow-s); }

.timeline { position: relative; margin-top: 14px; padding-left: 2px; }
.tl-item { display: flex; gap: 12px; position: relative; padding-bottom: 18px; }
.tl-item::before { content: ""; position: absolute; left: 16px; top: 34px; bottom: 0; width: 1.5px; background: var(--line); }
.tl-item:last-child::before { display: none; }
.tl-ico { width: 34px; height: 34px; flex: 0 0 34px; border-radius: 12px; display: grid; place-items: center; background: var(--surface); border: 1px solid var(--line); color: var(--muted); position: relative; z-index: 1; box-shadow: var(--shadow-s); }
.tl-ico svg { width: 16px; height: 16px; }
.tl-ico.note { color: var(--brand); background: var(--brand-soft); border-color: transparent; }
.tl-ico.call { color: var(--green); background: var(--green-soft); border-color: transparent; }
.tl-ico.task { color: var(--amber); background: var(--amber-soft); border-color: transparent; }
.tl-ico.system { color: var(--muted); }
.tl-body { flex: 1; min-width: 0; padding-top: 1px; }
.tl-top { display: flex; align-items: baseline; gap: 8px; }
.tl-author { font-size: 12.5px; font-weight: 650; }
.tl-time { font-size: 11.5px; color: var(--muted-2); margin-left: auto; flex: none; }
.tl-text { font-size: 14px; color: var(--ink-2); margin-top: 3px; line-height: 1.42; white-space: pre-wrap; word-break: break-word; }
.tl-text.task-text-line { color: var(--ink); font-weight: 550; }
.tl-done { color: var(--green); font-size: 11.5px; font-weight: 650; display: inline-flex; align-items: center; gap: 4px; margin-top: 5px; }
.tl-due { color: var(--amber); font-size: 11.5px; font-weight: 650; display: inline-flex; align-items: center; gap: 4px; margin-top: 5px; }

.composer {
  position: fixed;
  z-index: 50;
  left: 0;
  right: 0;
  bottom: 0;
  padding: 10px 14px calc(10px + env(safe-area-inset-bottom));
  background: color-mix(in srgb, var(--bg) 84%, transparent);
  backdrop-filter: blur(20px) saturate(160%);
  border-top: 1px solid var(--line);
  display: flex;
  gap: 9px;
  align-items: flex-end;
  transition: transform 0.2s var(--ease);
}
.composer .input { height: 46px; border-radius: 15px; background: var(--surface); box-shadow: var(--shadow-s); }
.composer .send { width: 46px; height: 46px; flex: 0 0 46px; border-radius: 15px; background: var(--brand-grad); color: #fff; display: grid; place-items: center; box-shadow: 0 8px 18px -10px rgba(78, 91, 242, 0.9); transition: transform 0.15s var(--ease); }
.composer .send:active { transform: scale(0.92); }
.composer .send svg { width: 20px; height: 20px; }

/* ==========================================================================
   Задачи и контакты
   ========================================================================== */
.segmented { display: flex; gap: 3px; padding: 3px; background: var(--surface-3); border-radius: 13px; margin: 4px 0 14px; overflow-x: auto; scrollbar-width: none; }
.segmented::-webkit-scrollbar { display: none; }
.segmented button { flex: 1 0 auto; height: 34px; padding: 0 12px; border-radius: 10px; font-size: 12.5px; font-weight: 650; color: var(--muted); transition: all 0.18s var(--ease); white-space: nowrap; }
.segmented button.on { background: var(--surface); color: var(--ink); box-shadow: var(--shadow-s); }
.segmented .badge { display: inline-block; margin-left: 5px; font-size: 10.5px; color: var(--red); font-weight: 700; }

.contact-row { display: flex; align-items: center; gap: 12px; padding: 10px 4px; }
.contact-row + .contact-row { border-top: 1px solid var(--line); }
.contact-row .main { flex: 1; min-width: 0; }
.contact-row .nm { font-weight: 620; font-size: 14.5px; }
.contact-row .sb { font-size: 12px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; margin-top: 2px; }
.contact-row .call { width: 38px; height: 38px; border-radius: 12px; background: var(--green-soft); color: var(--green); display: grid; place-items: center; flex: none; }
.contact-row .call svg { width: 18px; height: 18px; }
.letter { font-size: 11px; font-weight: 700; color: var(--muted-2); letter-spacing: 0.08em; padding: 14px 2px 5px; }

.contact-hero { display: flex; flex-direction: column; align-items: center; text-align: center; padding: 12px 0 6px; }
.contact-hero .nm { font-size: 22px; font-weight: 780; letter-spacing: -0.03em; margin-top: 12px; }
.contact-hero .pos { color: var(--muted); font-size: 13px; margin-top: 2px; }
.contact-actions { display: grid; grid-template-columns: repeat(2, 1fr); gap: 8px; margin: 16px 0 6px; }

/* ==========================================================================
   Ещё / настройки
   ========================================================================== */
.profile-card { display: flex; align-items: center; gap: 14px; padding: 16px; }
.profile-card .nm { font-size: 17px; font-weight: 720; letter-spacing: -0.02em; }
.profile-card .acc { font-size: 12.5px; color: var(--muted); margin-top: 2px; }
.menu-card { overflow: hidden; margin-top: 14px; }
.menu-row { display: flex; align-items: center; gap: 13px; padding: 14px 15px; width: 100%; text-align: left; font-weight: 550; font-size: 14.5px; transition: background 0.15s; }
.menu-row + .menu-row { border-top: 1px solid var(--line); }
.menu-row:active { background: var(--surface-2); }
.menu-row .mi { width: 34px; height: 34px; flex: 0 0 34px; border-radius: 11px; display: grid; place-items: center; background: var(--surface-2); color: var(--ink-2); }
.menu-row .mi svg { width: 18px; height: 18px; }
.menu-row .mtext { flex: 1; min-width: 0; }
.menu-row .mtext small { display: block; font-size: 12px; color: var(--muted); font-weight: 500; margin-top: 1px; }
.menu-row .val { color: var(--muted); font-size: 13px; }
.menu-row.danger { color: var(--red); }
.menu-row.danger .mi { background: var(--red-soft); color: var(--red); }
.menu-title { font-size: 12px; font-weight: 700; letter-spacing: 0.05em; text-transform: uppercase; color: var(--muted-2); margin: 24px 4px 8px; }

/* ==========================================================================
   Адаптив
   ========================================================================== */
@media (min-width: 760px) {
  :root { --gutter: 22px; }
  .view { max-width: 820px; }
  .sheet { border-radius: 26px; bottom: 24px; padding-bottom: 22px; }
  .deal-hero { border-radius: 0 0 34px 34px; padding-bottom: 30px; }
}

@media (min-width: 1024px) {
  :root { --gutter: 28px; }
  .view { margin-left: 264px; max-width: 1000px; padding-bottom: 40px; }
  .view.no-tabbar { padding-bottom: 40px; }
  .tabbar { display: none !important; }
  .sidebar { display: flex; }
  .topbar { margin-left: calc(var(--gutter) * -1); }
  .deal-hero { margin-left: calc(var(--gutter) * -1); }
  .home-grid { display: grid; grid-template-columns: 1.05fr 0.95fr; gap: 26px; align-items: start; }
  .home-grid .col { min-width: 0; }
  .deal-view .deal-wrap { display: grid; grid-template-columns: 1.15fr 0.85fr; gap: 20px; align-items: start; }
  .composer { left: 264px; }
  .toasts { left: calc(50% + 132px); }
  .offline { bottom: 24px; }
  .board-col { flex-basis: 300px; max-width: 300px; }
  .quick { grid-template-columns: repeat(4, 1fr); }
}

.sidebar {
  display: none;
  position: fixed;
  left: 0;
  top: 0;
  bottom: 0;
  width: 264px;
  padding: 24px 18px;
  flex-direction: column;
  gap: 6px;
  background: var(--surface);
  border-right: 1px solid var(--line);
  z-index: 45;
}
.sidebar .brand { display: flex; align-items: center; gap: 11px; padding: 0 8px 22px; }
.sidebar .nav-item { display: flex; align-items: center; gap: 12px; padding: 11px 12px; border-radius: 13px; color: var(--muted); font-weight: 600; font-size: 14px; transition: all 0.18s; }
.sidebar .nav-item svg { width: 20px; height: 20px; }
.sidebar .nav-item:hover { background: var(--surface-2); color: var(--ink); }
.sidebar .nav-item.active { background: var(--brand-soft); color: var(--brand); }
.sidebar .foot { margin-top: auto; padding: 12px; border-radius: 16px; background: var(--surface-2); font-size: 12px; color: var(--muted); }
.sidebar .foot b { color: var(--ink); display: block; font-size: 13px; margin-bottom: 2px; }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: 0.01ms !important; transition-duration: 0.01ms !important; }
}
/* ==========================================================================
   Дополнения: FAB, переходы между экранами, лента по дням
   ========================================================================== */
.fab {
  position: fixed;
  right: 18px;
  bottom: calc(var(--tabbar-h) + 26px + env(safe-area-inset-bottom));
  width: 58px;
  height: 58px;
  border-radius: 20px;
  display: grid;
  place-items: center;
  background: var(--brand-grad);
  color: #fff;
  z-index: 41;
  box-shadow: 0 16px 32px -12px rgba(78, 91, 242, 0.95), inset 0 1px 0 rgba(255, 255, 255, 0.32);
  transition: transform 0.18s var(--ease);
  animation: fab-in 0.3s var(--ease);
}
.fab svg { width: 26px; height: 26px; stroke-width: 2.2; }
.fab:active { transform: scale(0.92) rotate(90deg); }
@keyframes fab-in { from { opacity: 0; transform: scale(0.6) translateY(10px); } }

.stage-head { width: 100%; text-align: left; }
.stage-head .name { flex: 1; }
.menu-row .go, .info-row .go, .section-head .go { width: 18px; height: 18px; color: var(--muted-2); flex: none; }

.feed-day {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 10.5px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted-2);
  margin: 16px 2px 12px;
}
.feed-day::after { content: ""; height: 1px; background: var(--line); flex: 1; }
.timeline > .feed-day:first-child { margin-top: 4px; }

.task-day { margin-bottom: 14px; }

.login-view { padding: 0 !important; max-width: none !important; }

/* View Transitions: мягкое проявление между экранами */
@supports (view-transition-name: none) {
  ::view-transition-old(root) { animation: vt-out 0.14s ease both; }
  ::view-transition-new(root) { animation: vt-in 0.24s var(--ease) both; }
  @keyframes vt-out { to { opacity: 0; } }
  @keyframes vt-in { from { opacity: 0; } }
  .tabbar, .fab, .composer { view-transition-name: none; }
}

@media (min-width: 1024px) {
  .fab { display: none; }
  .login-view { margin-left: 0 !important; }
  .composer { left: 264px; }
}

@media (max-width: 360px) {
  :root { --gutter: 13px; }
  .hero .sum { font-size: 32px; }
  .quick-btn { font-size: 10.5px; }
  .stat .v { font-size: 19px; }
}

/* --- правки после визуальной проверки --- */
@media (min-width: 1024px) { .sidebar { display: flex; } }

.tabbar { background: color-mix(in srgb, var(--surface) 94%, transparent); }
.segmented .badge { color: var(--brand); }
.segmented button.on .badge { color: var(--brand); }

.deal-view { padding-bottom: calc(104px + env(safe-area-inset-bottom)) !important; }
.deal-hero { padding-bottom: 30px; }
.progress { margin: 16px 0 2px; }

.chips-scroll { mask-image: linear-gradient(90deg, #000 0, #000 calc(100% - 22px), transparent 100%); -webkit-mask-image: linear-gradient(90deg, #000 0, #000 calc(100% - 22px), transparent 100%); }
.board { mask-image: linear-gradient(90deg, #000 0, #000 calc(100% - 26px), transparent 100%); -webkit-mask-image: linear-gradient(90deg, #000 0, #000 calc(100% - 26px), transparent 100%); }

.field-cell.full { grid-column: 1 / -1; }
.sheet-close { position: absolute; top: 12px; right: 12px; width: 36px; height: 36px; border-radius: 12px; background: var(--surface-2); color: var(--muted); display: grid; place-items: center; }
.sheet-close svg { width: 18px; height: 18px; }

@media (min-width: 1024px) {
  .deal-view { max-width: 860px; margin-left: calc(264px + 24px); }
  .deal-view .composer { left: 264px; }
}
.home-hello { min-width: 0; flex: 1; padding-right: 6px; }
.home-hello .name { font-size: 24px; }
.home-head .avatar { margin-left: 4px; }
.searchbar .input { font-size: 16px; }
.check-circle { position: relative; }
.check-circle::after { content: ""; position: absolute; inset: -11px; border-radius: 50%; }
.task-go { width: 16px; height: 16px; flex: 0 0 16px; align-self: center; color: var(--muted-2); margin-left: 2px; }
.task-row:active .task-go { color: var(--brand); }
.toast { pointer-events: none; }
.toast .toast-btn {
  pointer-events: auto;
  margin-left: auto;
  flex: none;
  padding: 6px 10px;
  border-radius: 9px;
  background: rgba(255, 255, 255, 0.14);
  color: #fff;
  font-size: 12.5px;
  font-weight: 650;
}
.toast .toast-btn:active { background: rgba(255, 255, 255, 0.24); }
.deal-view { padding-bottom: calc(40px + env(safe-area-inset-bottom)) !important; }
@media (min-width: 1024px) {
  .board { scrollbar-width: thin; scrollbar-color: var(--line-strong) transparent; padding-bottom: 30px; cursor: grab; }
  .board::-webkit-scrollbar { display: block; height: 8px; }
  .board::-webkit-scrollbar-track { background: transparent; }
  .board::-webkit-scrollbar-thumb { background: var(--line-strong); border-radius: 99px; }
  .board-card { -webkit-user-drag: none; }
}
.filter-sec { margin-bottom: 18px; }
.filter-title { font-size: 11.5px; font-weight: 700; letter-spacing: 0.05em; text-transform: uppercase; color: var(--muted-2); margin: 0 2px 10px; }
.chips-wrap { display: flex; flex-wrap: wrap; gap: 8px; }
.chips-wrap .chip { height: 34px; font-size: 12.5px; }
.chips-wrap .stage-dot { width: 7px; height: 7px; border-radius: 50%; flex: none; }
.preset-row { display: flex; align-items: center; gap: 6px; margin-bottom: 6px; }
.preset-apply { flex: 1; text-align: left; padding: 11px 12px; border-radius: 12px; background: var(--surface-2); border: 1px solid var(--line); font-weight: 600; font-size: 13px; }
.preset-apply:active { background: var(--surface-3); }
.preset-del { width: 36px; height: 36px; flex: 0 0 36px; border-radius: 11px; background: var(--surface-2); color: var(--muted); display: grid; place-items: center; }
.ptr {
  position: fixed;
  z-index: 70;
  top: 6px;
  left: 50%;
  transform: translate(-50%, -48px);
  width: 38px;
  height: 38px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: var(--surface);
  border: 1px solid var(--line);
  box-shadow: var(--shadow-m);
.action { font-size: 10.5px; line-height: 1.15; text-align: center; }
