/* ============================================================
   Планер — тёмные и светлые темы, розовый по умолчанию
   ============================================================ */

/* ---------- Темы ---------- */
:root,
[data-theme="rose"] {
  --bg: #fdf2f6;
  --bg-soft: #ffe9f0;
  --surface: #ffffff;
  --surface-2: #fff8fb;
  --surface-3: #fdeef3;
  --ink: #3a1d29;
  --ink-soft: #57323f;
  --muted: #a07f8d;
  --line: #f4d9e3;
  --line-strong: #eec3d2;
  --accent: #e6537f;
  --accent-2: #ff9fbb;
  --accent-deep: #8f2b4e;
  --accent-soft: rgba(230, 83, 127, .12);
  --accent-soft-2: rgba(230, 83, 127, .2);
  --accent-ink: #ffffff;
  --danger: #e5484d;
  --danger-soft: rgba(229, 72, 77, .12);
  --ok: #2f9e6b;
  --ok-soft: rgba(47, 158, 107, .12);
  --shadow: 0 24px 60px rgba(143, 43, 78, .14);
  --shadow-sm: 0 8px 24px rgba(143, 43, 78, .08);
  --hero: linear-gradient(150deg, #7d2342 0%, #b93a63 55%, #e6537f 100%);
  --meta: #e6537f;
}

[data-theme="light"] {
  --bg: #f4f6fb;
  --bg-soft: #eef1fa;
  --surface: #ffffff;
  --surface-2: #f8faff;
  --surface-3: #f0f3fb;
  --ink: #172033;
  --ink-soft: #33405c;
  --muted: #7c869b;
  --line: #e5e9f2;
  --line-strong: #d6dceb;
  --accent: #5b6cff;
  --accent-2: #9aa6ff;
  --accent-deep: #2f3aa8;
  --accent-soft: rgba(91, 108, 255, .1);
  --accent-soft-2: rgba(91, 108, 255, .18);
  --accent-ink: #ffffff;
  --danger: #e5484d;
  --danger-soft: rgba(229, 72, 77, .1);
  --ok: #12805c;
  --ok-soft: rgba(18, 128, 92, .1);
  --shadow: 0 24px 60px rgba(23, 32, 51, .1);
  --shadow-sm: 0 8px 24px rgba(23, 32, 51, .06);
  --hero: linear-gradient(150deg, #2f3aa8 0%, #4656d8 55%, #5b6cff 100%);
  --meta: #5b6cff;
}

[data-theme="dark"] {
  --bg: #0b0f16;
  --bg-soft: #0e1320;
  --surface: #151b25;
  --surface-2: #1a2130;
  --surface-3: #202838;
  --ink: #e9eef6;
  --ink-soft: #c3ccdb;
  --muted: #8492a6;
  --line: #252e3d;
  --line-strong: #334052;
  --accent: #ff5c8a;
  --accent-2: #ff9fbb;
  --accent-deep: #8f2345;
  --accent-soft: rgba(255, 92, 138, .13);
  --accent-soft-2: rgba(255, 92, 138, .22);
  --accent-ink: #1a0a10;
  --danger: #ff6b6f;
  --danger-soft: rgba(255, 107, 111, .14);
  --ok: #3ddc97;
  --ok-soft: rgba(61, 220, 151, .12);
  --shadow: 0 28px 70px rgba(0, 0, 0, .5);
  --shadow-sm: 0 10px 30px rgba(0, 0, 0, .35);
  --hero: linear-gradient(150deg, #2a0d18 0%, #6d1f37 55%, #c23a62 100%);
  --meta: #ff5c8a;
}

[data-theme="lavender"] {
  --bg: #f6f3ff;
  --bg-soft: #efe9ff;
  --surface: #ffffff;
  --surface-2: #faf8ff;
  --surface-3: #f3efff;
  --ink: #2a2144;
  --ink-soft: #453a68;
  --muted: #8a80a8;
  --line: #e7e0fb;
  --line-strong: #d9cff7;
  --accent: #7c5cff;
  --accent-2: #b9a6ff;
  --accent-deep: #43239c;
  --accent-soft: rgba(124, 92, 255, .1);
  --accent-soft-2: rgba(124, 92, 255, .18);
  --accent-ink: #ffffff;
  --danger: #e5484d;
  --danger-soft: rgba(229, 72, 77, .1);
  --ok: #15805f;
  --ok-soft: rgba(21, 128, 95, .1);
  --shadow: 0 24px 60px rgba(67, 35, 156, .14);
  --shadow-sm: 0 8px 24px rgba(67, 35, 156, .08);
  --hero: linear-gradient(150deg, #34186f 0%, #5b3ad6 55%, #7c5cff 100%);
  --meta: #7c5cff;
}

[data-theme="mint"] {
  --bg: #f1fbf7;
  --bg-soft: #e6f8f0;
  --surface: #ffffff;
  --surface-2: #f7fdfa;
  --surface-3: #eefaf4;
  --ink: #12332a;
  --ink-soft: #285247;
  --muted: #77978d;
  --line: #d9f0e7;
  --line-strong: #c4e8da;
  --accent: #0f9d76;
  --accent-2: #6fdcbb;
  --accent-deep: #075a43;
  --accent-soft: rgba(15, 157, 118, .1);
  --accent-soft-2: rgba(15, 157, 118, .18);
  --accent-ink: #ffffff;
  --danger: #e5484d;
  --danger-soft: rgba(229, 72, 77, .1);
  --ok: #0f9d76;
  --ok-soft: rgba(15, 157, 118, .12);
  --shadow: 0 24px 60px rgba(7, 90, 67, .13);
  --shadow-sm: 0 8px 24px rgba(7, 90, 67, .07);
  --hero: linear-gradient(150deg, #05493a 0%, #0b7a5c 55%, #0f9d76 100%);
  --meta: #0f9d76;
}

[data-theme="ocean"] {
  --bg: #eef7ff;
  --bg-soft: #e4f2ff;
  --surface: #ffffff;
  --surface-2: #f6fbff;
  --surface-3: #eaf5ff;
  --ink: #102a3d;
  --ink-soft: #234a63;
  --muted: #7391a6;
  --line: #d8ebfa;
  --line-strong: #c1e0f5;
  --accent: #0b8fd6;
  --accent-2: #6cc6f5;
  --accent-deep: #063f63;
  --accent-soft: rgba(11, 143, 214, .1);
  --accent-soft-2: rgba(11, 143, 214, .18);
  --accent-ink: #ffffff;
  --danger: #e5484d;
  --danger-soft: rgba(229, 72, 77, .1);
  --ok: #0f8a63;
  --ok-soft: rgba(15, 138, 99, .1);
  --shadow: 0 24px 60px rgba(6, 63, 99, .14);
  --shadow-sm: 0 8px 24px rgba(6, 63, 99, .08);
  --hero: linear-gradient(150deg, #04324f 0%, #086da5 55%, #0b8fd6 100%);
  --meta: #0b8fd6;
}

/* ---------- База ---------- */
* { box-sizing: border-box; margin: 0; padding: 0; }

[hidden] { display: none !important; }

html { scroll-behavior: smooth; }

body {
  font-family: 'Manrope', system-ui, -apple-system, 'Segoe UI', sans-serif;
  font-size: 15px;
  line-height: 1.5;
  color: var(--ink);
  background:
    radial-gradient(1100px 560px at 88% -8%, var(--accent-soft), transparent 62%),
    radial-gradient(900px 520px at -12% 18%, var(--accent-soft), transparent 58%),
    var(--bg);
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
  transition: background .35s ease, color .35s ease;
}

h1, h2, h3, .brand-name {
  font-family: 'Unbounded', 'Manrope', system-ui, sans-serif;
  font-weight: 700;
  letter-spacing: -.02em;
  line-height: 1.15;
}

.sprite { position: absolute; width: 0; height: 0; overflow: hidden; }

.icon {
  width: 20px; height: 20px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.9;
  stroke-linecap: round;
  stroke-linejoin: round;
  flex-shrink: 0;
}

button { font: inherit; color: inherit; cursor: pointer; }
input, textarea, select { font: inherit; color: inherit; }
a { color: inherit; }

::selection { background: var(--accent-soft-2); }

/* ---------- Кнопки и поля ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  border: 1px solid transparent;
  border-radius: 13px;
  padding: 10px 18px;
  font-weight: 700;
  font-size: 14px;
  line-height: 1.2;
  text-decoration: none;
  transition: transform .15s ease, box-shadow .2s ease, background .2s ease, border-color .2s ease, opacity .2s;
  white-space: nowrap;
}
.btn:active { transform: translateY(1px) scale(.99); }
.btn .icon { width: 18px; height: 18px; }

.btn-primary {
  background: var(--accent);
  color: var(--accent-ink);
  box-shadow: 0 10px 24px var(--accent-soft-2);
}
.btn-primary:hover { background: var(--accent); box-shadow: 0 14px 30px var(--accent-soft-2); transform: translateY(-1px); }
.btn-primary:disabled { opacity: .6; transform: none; cursor: progress; }

.btn-ghost {
  background: var(--surface);
  border-color: var(--line);
  color: var(--ink-soft);
}
.btn-ghost:hover { border-color: var(--line-strong); background: var(--surface-2); }
.btn-ghost.danger { color: var(--danger); }
.btn-ghost.danger:hover { background: var(--danger-soft); border-color: transparent; }

.btn-danger {
  background: var(--danger);
  color: #fff;
  box-shadow: 0 10px 24px var(--danger-soft);
}
.btn-danger:hover { filter: brightness(1.06); transform: translateY(-1px); }

.btn-block { width: 100%; }

.icon-btn {
  display: inline-grid; place-items: center;
  width: 40px; height: 40px;
  border: 1px solid transparent;
  border-radius: 12px;
  background: transparent;
  color: var(--muted);
  transition: background .18s, color .18s, border-color .18s;
}
.icon-btn:hover { background: var(--surface-3); color: var(--ink); }
.icon-btn .icon { width: 19px; height: 19px; }

.field { display: flex; flex-direction: column; gap: 7px; min-width: 0; }
.field-label {
  font-size: 12.5px; font-weight: 700; letter-spacing: .04em;
  text-transform: uppercase; color: var(--muted);
}
.field-label em {
  font-style: normal; text-transform: none; letter-spacing: 0;
  font-weight: 600; color: var(--muted); opacity: .7;
}

.input-wrap {
  display: flex; align-items: center; gap: 10px;
  background: var(--surface-2);
  border: 1px solid var(--line);
  border-radius: 13px;
  padding: 0 14px;
  transition: border-color .18s, box-shadow .18s, background .18s;
}
.input-wrap:focus-within {
  border-color: var(--accent);
  background: var(--surface);
  box-shadow: 0 0 0 4px var(--accent-soft);
}
.input-wrap .icon { color: var(--muted); width: 18px; height: 18px; }
.input-wrap input {
  flex: 1; min-width: 0;
  border: 0; outline: 0; background: transparent;
  padding: 13px 0;
  font-weight: 600;
}
.input-wrap input::placeholder { color: var(--muted); font-weight: 500; opacity: .8; }

.eye {
  border: 0; background: transparent; color: var(--muted);
  display: grid; place-items: center; width: 30px; height: 30px; border-radius: 8px;
}
.eye:hover { color: var(--ink); background: var(--surface-3); }

.input {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 13px;
  background: var(--surface-2);
  padding: 12px 14px;
  outline: 0;
  font-weight: 600;
  transition: border-color .18s, box-shadow .18s, background .18s;
}
.input::placeholder { color: var(--muted); font-weight: 500; opacity: .8; }
.input:focus { border-color: var(--accent); background: var(--surface); box-shadow: 0 0 0 4px var(--accent-soft); }
textarea.input { resize: vertical; min-height: 84px; }

.field-row { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }

/* ---------- Кастомные выбор даты и категории ---------- */
.date-control {
  display: flex; align-items: center; gap: 2px;
  border: 1px solid var(--line);
  border-radius: 13px;
  background: var(--surface-2);
  padding-right: 6px;
  transition: border-color .18s, box-shadow .18s, background .18s;
}
.date-control:focus-within {
  border-color: var(--accent);
  background: var(--surface);
  box-shadow: 0 0 0 4px var(--accent-soft);
}
.date-control .date-display {
  border: 0;
  background: transparent;
  box-shadow: none;
  padding: 12px 0 12px 14px;
  cursor: pointer;
}
.date-control .date-display:focus {
  border: 0;
  background: transparent;
  box-shadow: none;
}
.date-open {
  flex-shrink: 0;
  width: 34px; height: 34px;
  display: grid; place-items: center;
  border: 0; border-radius: 9px;
  background: transparent;
  color: var(--muted);
}
.date-open:hover { color: var(--accent); background: var(--accent-soft); }
.date-open .icon { width: 17px; height: 17px; }

.cat-control { position: relative; }
.cat-trigger {
  display: flex; align-items: center; justify-content: space-between; gap: 8px;
  text-align: left; cursor: pointer;
}
.cat-value { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cat-chevron {
  flex-shrink: 0;
  width: 16px; height: 16px;
  color: var(--muted);
  transform: rotate(90deg);
  transition: transform .2s;
}
.cat-trigger[aria-expanded="true"] .cat-chevron { transform: rotate(-90deg); }

.date-pop, .cat-pop {
  position: fixed;
  z-index: 210;
  background: var(--surface);
  border: 1px solid var(--line-strong);
  border-radius: 18px;
  box-shadow: var(--shadow);
  max-width: calc(100vw - 20px);
}
.date-pop[hidden], .cat-pop[hidden] { display: none !important; }

.date-pop { width: 300px; padding: 12px; }
.date-pop-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-bottom: 8px; }
.date-pop-head b { font-size: 13.5px; }
.date-nav { width: 32px; height: 32px; border-radius: 9px; }
.date-nav .icon { width: 16px; height: 16px; }
.date-nav.prev .icon { transform: rotate(180deg); }
.date-pop-week, .date-pop-grid { display: grid; grid-template-columns: repeat(7, 1fr); gap: 2px; }
.date-pop-week span {
  padding: 4px 0;
  text-align: center;
  font-size: 10px; font-weight: 800;
  letter-spacing: .04em; text-transform: uppercase;
  color: var(--muted);
}
.date-day {
  height: 34px;
  display: grid; place-items: center;
  border: 0; border-radius: 10px;
  background: transparent;
  color: var(--ink);
  font-weight: 700; font-size: 12.5px;
  transition: background .15s, color .15s, box-shadow .15s;
}
.date-day:hover { background: var(--accent-soft); color: var(--accent); }
.date-day.today { color: var(--accent); box-shadow: inset 0 0 0 1px var(--accent); }
.date-day.selected { background: var(--accent); color: #fff; box-shadow: none; }
.date-day.blank { pointer-events: none; }
.date-pop-foot {
  display: flex; justify-content: space-between; gap: 8px;
  margin-top: 8px; padding-top: 8px;
  border-top: 1px solid var(--line);
}
.date-action {
  border: 0; border-radius: 8px;
  background: transparent;
  color: var(--accent);
  padding: 5px 7px;
  font-weight: 800; font-size: 11.5px;
}
.date-action:hover { background: var(--accent-soft); }
.date-action.muted { color: var(--muted); }

.cat-pop { width: 240px; padding: 8px; }
.cat-pop-list { display: flex; flex-direction: column; gap: 2px; max-height: 190px; overflow-y: auto; }
.cat-option {
  display: flex; align-items: center; gap: 8px;
  border: 0; border-radius: 9px;
  background: transparent;
  padding: 9px 10px;
  color: var(--ink);
  text-align: left;
  font-weight: 700; font-size: 13px;
}
.cat-option:hover { background: var(--surface-2); }
.cat-option.active { background: var(--accent-soft); color: var(--accent); }
.cat-dot { width: 8px; height: 8px; border-radius: 50%; flex-shrink: 0; }
.cat-check { margin-left: auto; width: 14px; height: 14px; }
.cat-pop-custom {
  display: flex; gap: 6px;
  margin-top: 6px; padding-top: 8px;
  border-top: 1px solid var(--line);
}
.cat-pop-custom .input { padding: 9px 10px; font-size: 12.5px; border-radius: 9px; }
.cat-pop-custom .btn { padding: 9px 12px; font-size: 12px; border-radius: 9px; }

/* ---------- Экран входа ---------- */
.auth {
  position: relative;
  display: grid;
  grid-template-columns: 1.05fr .95fr;
  min-height: 100vh;
  background: var(--bg);
}

/* ---------- Тема на экране входа ---------- */
.auth-theme {
  position: absolute;
  top: clamp(16px, 3vw, 26px);
  right: clamp(16px, 3vw, 26px);
  z-index: 30;
}
.auth-theme-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  height: 42px;
  padding: 0 15px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--surface);
  color: var(--ink-soft);
  font-size: 13px;
  font-weight: 800;
  box-shadow: var(--shadow-sm);
  transition: border-color .18s, box-shadow .18s, transform .18s;
}
.auth-theme-btn:hover { border-color: var(--accent); transform: translateY(-1px); box-shadow: var(--shadow); }
.auth-theme-btn .icon { width: 17px; height: 17px; color: var(--accent); }
.auth-theme-btn[aria-expanded="true"] { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }

.auth-theme-pop {
  position: absolute;
  top: calc(100% + 10px);
  right: 0;
  width: 254px;
  padding: 14px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 18px;
  box-shadow: var(--shadow);
  animation: rise .22s cubic-bezier(.2, .7, .2, 1) both;
}
.auth-theme-title {
  font-size: 11px;
  font-weight: 800;
  letter-spacing: .12em;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: 10px;
}

.auth-hero {
  position: relative;
  overflow: hidden;
  background: var(--hero);
  color: #fff;
  padding: clamp(28px, 5vw, 64px);
  display: flex;
  flex-direction: column;
  gap: clamp(24px, 4vh, 44px);
}

.hero-glow {
  position: absolute;
  border-radius: 50%;
  filter: blur(10px);
  pointer-events: none;
}
.hero-glow.g1 {
  width: 520px; height: 520px;
  right: -160px; top: -180px;
  background: rgba(255, 255, 255, .16);
}
.hero-glow.g2 {
  width: 380px; height: 380px;
  left: -140px; bottom: -160px;
  background: rgba(255, 255, 255, .1);
}

.brand {
  display: inline-flex; align-items: center; gap: 11px;
  text-decoration: none;
  position: relative; z-index: 1;
}
.brand-mark {
  width: 40px; height: 40px;
  display: grid; place-items: center;
  border-radius: 13px;
  background: var(--accent);
  color: var(--accent-ink);
  box-shadow: 0 8px 20px var(--accent-soft-2);
}
.brand-mark .icon { width: 22px; height: 22px; stroke-width: 2.6; }
.brand-name { font-size: 20px; font-weight: 700; letter-spacing: -.01em; }
.brand-lg .brand-mark { background: #fff; color: var(--accent-deep); box-shadow: 0 10px 26px rgba(0, 0, 0, .18); }
.brand-lg .brand-name { color: #fff; font-size: 24px; }

.hero-copy { position: relative; z-index: 1; max-width: 520px; }
.eyebrow {
  display: inline-flex; align-items: center; gap: 8px;
  font-size: 12.5px; font-weight: 800; letter-spacing: .16em; text-transform: uppercase;
  color: rgba(255, 255, 255, .82);
  margin-bottom: 18px;
}
.dot-live {
  width: 8px; height: 8px; border-radius: 50%;
  background: #fff;
  box-shadow: 0 0 0 4px rgba(255, 255, 255, .22);
  animation: pulse 2s infinite;
}
.hero-copy h1 {
  font-size: clamp(38px, 5.6vw, 66px);
  font-weight: 800;
  color: #fff;
  letter-spacing: -.03em;
  margin-bottom: 18px;
}
.hero-copy h1 span { color: rgba(255, 255, 255, .62); }
.hero-sub {
  font-size: clamp(15px, 1.4vw, 17px);
  line-height: 1.65;
  color: rgba(255, 255, 255, .84);
  max-width: 460px;
}

.hero-preview {
  position: relative; z-index: 1;
  width: min(430px, 100%);
  margin-top: auto;
  border-radius: 24px;
  padding: 20px 20px 12px;
  background: rgba(255, 255, 255, .13);
  border: 1px solid rgba(255, 255, 255, .25);
  backdrop-filter: blur(18px);
  box-shadow: 0 30px 60px rgba(0, 0, 0, .22);
}
.preview-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 14px; }
.preview-date { font-size: 12px; font-weight: 800; letter-spacing: .14em; text-transform: uppercase; color: rgba(255,255,255,.65); }
.preview-title { font-weight: 800; font-size: 16px; color: #fff; }
.preview-ring { position: relative; width: 58px; height: 58px; display: grid; place-items: center; }
.preview-ring svg { width: 58px; height: 58px; transform: rotate(-90deg); }
.preview-ring circle { fill: none; stroke-width: 4; }
.preview-ring .ring-bg { stroke: rgba(255, 255, 255, .22); }
.preview-ring .ring-fill { stroke: #fff; stroke-linecap: round; stroke-dasharray: 113.1; }
.preview-ring b { position: absolute; font-size: 12.5px; font-weight: 800; color: #fff; }

.preview-list { list-style: none; display: flex; flex-direction: column; }
.preview-list li {
  display: flex; align-items: center; gap: 10px;
  padding: 9px 0;
  border-top: 1px solid rgba(255, 255, 255, .14);
  font-size: 13.5px; font-weight: 600; color: rgba(255, 255, 255, .92);
}
.preview-list li:first-child { border-top: 0; }
.preview-list li > span:nth-child(2) { flex: 1; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.preview-list li em {
  font-style: normal; font-size: 10.5px; font-weight: 800; letter-spacing: .06em;
  text-transform: uppercase; color: rgba(255, 255, 255, .6);
}
.pv-check {
  width: 20px; height: 20px; border-radius: 7px;
  border: 1.5px solid rgba(255, 255, 255, .5);
  display: grid; place-items: center; flex-shrink: 0;
}
.pv-check .icon { width: 13px; height: 13px; stroke-width: 3; color: transparent; }
.preview-list li.done .pv-check { background: #fff; border-color: #fff; }
.preview-list li.done .pv-check .icon { color: var(--accent-deep); }
.preview-list li.done > span:nth-child(2) { text-decoration: line-through; color: rgba(255, 255, 255, .6); }

.hero-footer {
  position: relative; z-index: 1;
  display: flex; align-items: center; gap: 8px;
  font-size: 12.5px; font-weight: 600;
  color: rgba(255, 255, 255, .68);
}
.hero-footer .icon { width: 15px; height: 15px; }

.auth-panel {
  display: grid; place-items: center;
  padding: clamp(20px, 4vw, 56px);
  background:
    radial-gradient(600px 400px at 100% 0%, var(--accent-soft), transparent 60%),
    var(--bg);
}
.auth-card {
  width: min(430px, 100%);
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 26px;
  padding: clamp(22px, 3vw, 34px);
  box-shadow: var(--shadow);
  animation: rise .5s cubic-bezier(.2, .7, .2, 1) both;
}

.auth-tabs {
  display: flex; gap: 4px;
  background: var(--surface-3);
  border-radius: 12px;
  padding: 4px;
  margin-bottom: 26px;
}
.auth-tab {
  flex: 1; border: 0; background: transparent;
  padding: 10px 12px; border-radius: 9px;
  font-weight: 800; font-size: 13.5px;
  color: var(--muted);
  transition: background .2s, color .2s, box-shadow .2s;
}
.auth-tab.active { background: var(--surface); color: var(--ink); box-shadow: var(--shadow-sm); }

.auth-heading { margin-bottom: 22px; }
.auth-heading h2 { font-size: 26px; margin-bottom: 6px; }
.auth-heading p { color: var(--muted); font-size: 14px; }

.auth-form { display: flex; flex-direction: column; gap: 15px; }
.auth-form .btn { margin-top: 6px; padding: 13px 18px; font-size: 15px; border-radius: 14px; }

.auth-error {
  margin-top: 16px;
  padding: 11px 14px;
  border-radius: 12px;
  background: var(--danger-soft);
  color: var(--danger);
  font-size: 13.5px; font-weight: 700;
  animation: shake .35s ease;
}
.auth-note { margin-top: 18px; text-align: center; font-size: 13.5px; color: var(--muted); font-weight: 600; }
.link {
  border: 0; background: transparent; padding: 0;
  color: var(--accent); font-weight: 800; text-decoration: underline;
  text-decoration-thickness: 2px; text-underline-offset: 3px;
}

.strength { display: flex; align-items: center; gap: 6px; margin-top: -4px; }
.strength span {
  height: 4px; flex: 1; border-radius: 4px;
  background: var(--line);
  transition: background .25s;
}
.strength em {
  font-style: normal; font-size: 11.5px; font-weight: 700;
  color: var(--muted); white-space: nowrap; margin-left: 4px;
}
.strength[data-score="1"] span:nth-child(1) { background: var(--danger); }
.strength[data-score="2"] span:nth-child(-n+2) { background: #f0a03c; }
.strength[data-score="3"] span { background: var(--ok); }

/* ---------- Приложение ---------- */
.app {
  display: grid;
  grid-template-columns: 272px minmax(0, 1fr);
  min-height: 100vh;
}

.sidebar {
  position: sticky; top: 0;
  height: 100vh;
  display: flex; flex-direction: column; gap: 24px;
  padding: 22px 18px;
  background: color-mix(in srgb, var(--surface) 72%, transparent);
  border-right: 1px solid var(--line);
  backdrop-filter: blur(20px);
  z-index: 40;
}

.side-top { display: flex; align-items: center; justify-content: space-between; padding: 2px 4px; }
.menu-close { display: none; }

.nav { display: flex; flex-direction: column; gap: 3px; }
.nav-item {
  display: flex; align-items: center; gap: 11px;
  border: 0; background: transparent;
  padding: 11px 13px;
  border-radius: 12px;
  font-weight: 700; font-size: 14px;
  color: var(--muted);
  text-align: left;
  transition: background .18s, color .18s;
}
.nav-item .icon { width: 18px; height: 18px; }
.nav-item span { flex: 1; }
.nav-item:hover { background: var(--surface-3); color: var(--ink); }
.nav-item.active { background: var(--accent-soft); color: var(--accent); }
.nav-item.active .icon { stroke-width: 2.2; }
.nav-count {
  font-size: 11px; font-weight: 800;
  min-width: 22px; text-align: center;
  padding: 2px 6px; border-radius: 999px;
  background: var(--surface-3); color: var(--muted);
}
.nav-item.active .nav-count { background: var(--accent); color: var(--accent-ink); }

.side-section { display: flex; flex-direction: column; gap: 9px; min-height: 0; }
.side-title {
  font-size: 11px; font-weight: 800;
  letter-spacing: .14em; text-transform: uppercase;
  color: var(--muted); padding: 0 5px;
}
.cat-list { display: flex; flex-wrap: wrap; gap: 6px; padding: 0 3px; max-height: 132px; overflow-y: auto; }
.cat-chip {
  display: inline-flex; align-items: center; gap: 7px;
  border: 1px solid var(--line);
  background: var(--surface);
  border-radius: 999px;
  padding: 5px 11px 5px 8px;
  font-size: 12px; font-weight: 700; color: var(--ink-soft);
  transition: border-color .18s, background .18s, color .18s;
}
.cat-chip i { width: 8px; height: 8px; border-radius: 50%; background: var(--accent); flex-shrink: 0; }
.cat-chip:hover { border-color: var(--line-strong); }
.cat-chip.active { border-color: var(--accent); background: var(--accent-soft); color: var(--accent); }
.cat-chip b { font-weight: 800; color: var(--muted); }
.cat-chip.active b { color: var(--accent); }

.theme-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 7px; }
.theme-btn {
  display: flex; flex-direction: column; align-items: center; gap: 5px;
  border: 1.5px solid var(--line);
  border-radius: 12px;
  background: var(--surface);
  padding: 8px 4px 7px;
  transition: border-color .18s, transform .18s, box-shadow .18s;
}
.theme-btn:hover { transform: translateY(-1px); box-shadow: var(--shadow-sm); }
.theme-btn.active { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.theme-dots { display: flex; gap: 3px; }
.theme-dots i { width: 11px; height: 11px; border-radius: 50%; }
.theme-btn span { font-size: 9.5px; font-weight: 800; letter-spacing: .02em; color: var(--muted); }
.theme-btn.active span { color: var(--ink); }

.side-bottom { margin-top: auto; }
.user-card {
  display: flex; align-items: center; gap: 11px;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 15px;
  background: var(--surface);
}
.avatar {
  width: 38px; height: 38px; border-radius: 12px;
  display: grid; place-items: center;
  background: var(--accent);
  color: var(--accent-ink);
  font-weight: 800; font-size: 16px;
  text-transform: uppercase;
  box-shadow: 0 6px 16px var(--accent-soft-2);
  flex-shrink: 0;
}
.user-meta { flex: 1; min-width: 0; }
.user-meta p { font-weight: 800; font-size: 13.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.user-meta span { font-size: 11px; color: var(--muted); font-weight: 600; }

.main {
  min-width: 0;
  padding: 26px clamp(16px, 3vw, 42px) 70px;
  max-width: 1320px;
  width: 100%;
  margin: 0 auto;
}

.topbar {
  display: flex; align-items: center; gap: 16px;
  margin-bottom: 24px;
}
.menu-btn { display: none; }
.hello { flex: 1; min-width: 0; }
.hello-date {
  font-size: 12px; font-weight: 800;
  letter-spacing: .12em; text-transform: uppercase;
  color: var(--muted);
  margin-bottom: 3px;
}
.hello h1 { font-size: clamp(21px, 2.4vw, 29px); }

.top-actions { display: flex; align-items: center; gap: 10px; }
.search {
  display: flex; align-items: center; gap: 8px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 13px;
  padding: 0 12px;
  height: 44px;
  width: clamp(180px, 22vw, 280px);
  transition: border-color .18s, box-shadow .18s;
}
.search:focus-within { border-color: var(--accent); box-shadow: 0 0 0 4px var(--accent-soft); }
.search .icon { color: var(--muted); width: 17px; height: 17px; }
.search input { flex: 1; min-width: 0; border: 0; outline: 0; background: transparent; font-weight: 600; font-size: 14px; }
.search input::placeholder { color: var(--muted); font-weight: 500; }
.search-clear { border: 0; background: transparent; color: var(--muted); display: grid; place-items: center; padding: 4px; border-radius: 6px; }
.search-clear:hover { color: var(--ink); background: var(--surface-3); }
.search input::-webkit-search-cancel-button { display: none; }

/* ---------- Статистика ---------- */
.stats { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; margin-bottom: 18px; }
.stat {
  position: relative;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 18px;
  padding: 15px 17px 14px;
  overflow: hidden;
  transition: transform .2s, box-shadow .2s, border-color .2s;
}
.stat:hover { transform: translateY(-2px); box-shadow: var(--shadow-sm); border-color: var(--line-strong); }
.stat::after {
  content: ""; position: absolute; inset: auto -30px -60px auto;
  width: 120px; height: 120px; border-radius: 50%;
  background: var(--accent-soft); pointer-events: none;
}
.stat-icon {
  width: 34px; height: 34px; border-radius: 10px;
  display: grid; place-items: center;
  margin-bottom: 10px;
}
.stat-icon .icon { width: 17px; height: 17px; }
.tint-a { background: var(--accent-soft); color: var(--accent); }
.tint-b { background: var(--ok-soft); color: var(--ok); }
.tint-c { background: rgba(240, 160, 60, .14); color: #d98a24; }
.tint-d { background: var(--danger-soft); color: var(--danger); }
.stat-value { font-family: 'Unbounded', sans-serif; font-size: 26px; font-weight: 700; line-height: 1.1; }
.stat-label { font-size: 12px; font-weight: 700; color: var(--muted); margin-top: 3px; }

/* ---------- Неделя ---------- */
.week-panel {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 22px;
  padding: 20px;
  margin-bottom: 18px;
  box-shadow: var(--shadow-sm);
}
.week-head { display: flex; align-items: center; justify-content: space-between; gap: 16px; margin-bottom: 16px; }
.section-kicker {
  font-size: 11px; font-weight: 800; letter-spacing: .14em;
  text-transform: uppercase; color: var(--muted); margin-bottom: 3px;
}
.week-head h2 { font-size: 18px; }

.week-progress { display: flex; align-items: center; gap: 12px; }
.ring { position: relative; width: 62px; height: 62px; display: grid; place-items: center; flex-shrink: 0; }
.ring svg { width: 62px; height: 62px; transform: rotate(-90deg); }
.ring circle { fill: none; stroke-width: 5; }
.ring .ring-bg { stroke: var(--surface-3); }
.ring .ring-fill {
  stroke: var(--accent);
  stroke-linecap: round;
  stroke-dasharray: 157.08;
  stroke-dashoffset: 157.08;
  transition: stroke-dashoffset .7s cubic-bezier(.2, .7, .2, 1);
}
.ring b { position: absolute; font-size: 12.5px; font-weight: 800; }
.week-progress-text { display: flex; flex-direction: column; }
.week-progress-text b { font-size: 14px; }
.week-progress-text span { font-size: 11.5px; color: var(--muted); font-weight: 600; }

.week-tools { display: flex; align-items: center; gap: 16px; flex-wrap: wrap; justify-content: flex-end; }
.week-nav { display: flex; align-items: center; gap: 6px; }
.week-arrow { width: 36px; height: 36px; border-radius: 12px; }
.week-arrow.back .icon { transform: rotate(180deg); }
.week-arrow:disabled { opacity: .35; cursor: not-allowed; }
.week-today {
  border: 1px solid var(--line);
  background: var(--surface-2);
  color: var(--accent);
  border-radius: 10px;
  padding: 7px 11px;
  font-size: 11.5px;
  font-weight: 800;
  letter-spacing: .01em;
  white-space: nowrap;
  transition: border-color .18s, background .18s;
}
.week-today:hover { border-color: var(--accent); background: var(--accent-soft); }

.week-strip { display: grid; grid-template-columns: repeat(7, 1fr); gap: 8px; }
.day-btn {
  display: flex; flex-direction: column; align-items: center; gap: 2px;
  border: 1px solid var(--line);
  background: var(--surface-2);
  border-radius: 14px;
  padding: 10px 6px 9px;
  transition: border-color .18s, background .18s, transform .18s, box-shadow .18s;
}
.day-btn:hover { transform: translateY(-2px); border-color: var(--line-strong); box-shadow: var(--shadow-sm); }
.day-btn.active { border-color: var(--accent); background: var(--accent-soft); }
.day-btn.today .day-num { color: var(--accent); }
.day-name { font-size: 10.5px; font-weight: 800; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); }
.day-num { font-family: 'Unbounded', sans-serif; font-size: 17px; font-weight: 700; line-height: 1.25; }
.day-meta { font-size: 9.5px; font-weight: 700; color: var(--muted); white-space: nowrap; }
.day-bar { width: 70%; height: 3px; border-radius: 3px; background: var(--surface-3); margin-top: 4px; overflow: hidden; }
.day-bar i { display: block; height: 100%; border-radius: 3px; background: var(--accent); transition: width .5s ease; }
.day-btn.active .day-bar { background: var(--accent-soft-2); }

/* ---------- Задачи ---------- */
.tasks-panel { min-height: 300px; }
.tasks-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; margin-bottom: 16px; flex-wrap: wrap; }
.tasks-heading h2 { font-size: 21px; }
.tasks-heading p { font-size: 13px; color: var(--muted); font-weight: 600; margin-top: 2px; }

.chips { display: flex; gap: 6px; flex-wrap: wrap; }
.chip {
  border: 1px solid var(--line);
  background: var(--surface);
  color: var(--muted);
  border-radius: 999px;
  padding: 7px 13px;
  font-size: 12px; font-weight: 800;
  transition: all .18s;
}
.chip:hover { border-color: var(--line-strong); color: var(--ink); }
.chip.active { background: var(--ink); border-color: var(--ink); color: var(--surface); }

.task-groups { display: flex; flex-direction: column; gap: 20px; }
.task-group { animation: rise .35s cubic-bezier(.2, .7, .2, 1) both; }
.group-head { display: flex; align-items: center; gap: 9px; margin-bottom: 8px; padding: 0 4px; }
.group-head h3 { font-size: 13px; font-weight: 800; letter-spacing: .04em; text-transform: uppercase; color: var(--muted); }
.group-head .dot { width: 7px; height: 7px; border-radius: 50%; background: var(--muted); opacity: .6; }
.group-head.overdue h3, .group-head.overdue .dot { color: var(--danger); background-color: var(--danger); }
.group-head .group-count {
  font-size: 11px; font-weight: 800; color: var(--muted);
  background: var(--surface-3); border-radius: 999px; padding: 1px 8px;
}
.group-head .line { flex: 1; height: 1px; background: var(--line); }

.task-list { display: flex; flex-direction: column; gap: 8px; }

.task {
  display: grid;
  grid-template-columns: 30px minmax(0, 1fr) auto;
  align-items: center;
  gap: 13px;
  position: relative;
  padding: 13px 14px 13px 13px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 15px;
  transition: border-color .18s, box-shadow .18s, transform .18s, opacity .2s;
  animation: rise .3s cubic-bezier(.2, .7, .2, 1) both;
}
.task:hover { border-color: var(--line-strong); box-shadow: var(--shadow-sm); transform: translateX(2px); }
.task::before {
  content: "";
  position: absolute; left: 0; top: 11px; bottom: 11px;
  width: 3px; border-radius: 0 3px 3px 0;
  background: var(--p-color, transparent);
  opacity: .9;
}
.task.p-urgent { --p-color: var(--danger); }
.task.p-high { --p-color: #f0a03c; }
.task.p-medium { --p-color: #5b8def; }
.task.p-low { --p-color: #3fbf8f; }
.task.is-overdue { border-color: color-mix(in srgb, var(--danger) 35%, var(--line)); }

.task-check {
  width: 26px; height: 26px;
  border-radius: 9px;
  border: 2px solid var(--line-strong);
  background: var(--surface-2);
  display: grid; place-items: center;
  color: transparent;
  transition: background .2s, border-color .2s, transform .15s;
  flex-shrink: 0;
}
.task-check .icon { width: 15px; height: 15px; stroke-width: 3.2; color: transparent; transition: color .15s; }
.task-check:hover { border-color: var(--accent); background: var(--accent-soft); transform: scale(1.05); }
.task.done .task-check { background: var(--accent); border-color: var(--accent); }
.task.done .task-check .icon { color: var(--accent-ink); }
.task.done { opacity: .72; }
.task.done:hover { opacity: 1; }

.task-body { min-width: 0; }
.task-title { font-weight: 700; font-size: 14.5px; line-height: 1.35; overflow-wrap: anywhere; }
.task.done .task-title { text-decoration: line-through; text-decoration-thickness: 1.5px; color: var(--muted); }
.task-notes { font-size: 12px; color: var(--muted); font-weight: 500; margin-top: 2px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.task-meta { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; margin-top: 6px; }
.meta {
  display: inline-flex; align-items: center; gap: 4px;
  font-size: 10.5px; font-weight: 800; letter-spacing: .02em;
  border-radius: 999px;
  padding: 2.5px 8px;
  background: var(--surface-3);
  color: var(--muted);
}
.meta .icon { width: 11px; height: 11px; stroke-width: 2.4; }
.meta.due-today { background: var(--accent-soft); color: var(--accent); }
.meta.due-overdue { background: var(--danger-soft); color: var(--danger); }
.meta.prio-urgent { background: var(--danger-soft); color: var(--danger); }
.meta.prio-high { background: rgba(240, 160, 60, .15); color: #c9821c; }
.meta.prio-medium { background: rgba(91, 141, 239, .14); color: #4a76cc; }
.meta.prio-low { background: rgba(63, 191, 143, .14); color: #2a9a6f; }
.meta.cat { background: transparent; border: 1px solid var(--line); color: var(--ink-soft); }
.meta.cat i { width: 7px; height: 7px; border-radius: 50%; background: var(--cat-color, var(--accent)); }

.task-actions { display: flex; gap: 3px; opacity: 0; transform: translateX(4px); transition: opacity .18s, transform .18s; }
.task:hover .task-actions, .task:focus-within .task-actions { opacity: 1; transform: none; }
.task-actions .icon-btn { width: 34px; height: 34px; border-radius: 10px; }
.task-actions .icon-btn .icon { width: 16px; height: 16px; }
.task-actions .del:hover { color: var(--danger); background: var(--danger-soft); }

.task.done .task-title { text-decoration-color: var(--muted); }

/* ---------- Периоды ---------- */
.group-head.periods h3 { color: var(--accent); }
.group-head.periods .dot { background: var(--accent); opacity: 1; }

.task.period::before {
  width: 4px;
  background: linear-gradient(180deg, var(--accent), var(--accent-2));
  opacity: 1;
}
.task.period.done::before { background: var(--ok); }
.task.period.expired::before { background: var(--danger); }

.period-meta {
  display: flex;
  align-items: center;
  gap: 7px;
  flex-wrap: wrap;
  margin-top: 7px;
}
.period-state {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 10.5px;
  font-weight: 800;
  letter-spacing: .02em;
  border-radius: 999px;
  padding: 2.5px 9px;
  background: var(--accent-soft);
  color: var(--accent);
}
.period-state .icon { width: 11px; height: 11px; stroke-width: 2.4; }
.period-state.upcoming { background: var(--surface-3); color: var(--ink-soft); }
.period-state.expired { background: var(--danger-soft); color: var(--danger); }
.period-state.done { background: var(--ok-soft); color: var(--ok); }

.period-progress {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-top: 9px;
}
.period-track {
  flex: 1;
  min-width: 70px;
  height: 7px;
  border-radius: 999px;
  background: var(--surface-3);
  overflow: hidden;
}
.period-track i {
  display: block;
  height: 100%;
  width: 0;
  border-radius: 999px;
  background: linear-gradient(90deg, var(--accent), var(--accent-2));
  transition: width .6s cubic-bezier(.2, .7, .2, 1);
}
.task.period.done .period-track i { background: var(--ok); }
.task.period.expired .period-track i { background: var(--danger); }
.period-pct {
  font-size: 11px;
  font-weight: 800;
  color: var(--muted);
  min-width: 38px;
  text-align: right;
}
.task.period.done .period-pct { color: var(--ok); }
.task.period.expired .period-pct { color: var(--danger); }

/* Период в списке — чуть просторнее */
.task.period { padding-top: 14px; padding-bottom: 14px; }
.task.period .task-title { font-size: 15px; }

/* ---------- Пустое состояние ---------- */
.empty {
  display: flex; flex-direction: column; align-items: center;
  text-align: center;
  padding: 54px 20px 40px;
  animation: rise .4s ease both;
}
.empty-icon {
  width: 74px; height: 74px; border-radius: 24px;
  display: grid; place-items: center;
  background: var(--accent-soft);
  color: var(--accent);
  margin-bottom: 18px;
}
.empty-icon .icon { width: 34px; height: 34px; stroke-width: 1.6; }
.empty h3 { font-size: 20px; margin-bottom: 6px; }
.empty p { color: var(--muted); font-weight: 600; font-size: 14px; max-width: 380px; margin-bottom: 18px; }
.empty-actions { display: flex; gap: 9px; flex-wrap: wrap; justify-content: center; }

/* ---------- Модалки ---------- */
.modal {
  position: fixed; inset: 0; z-index: 100;
  display: grid; place-items: center;
  padding: 18px;
}
.modal[hidden] { display: none; }
.modal-backdrop {
  position: absolute; inset: 0;
  background: rgba(12, 8, 14, .5);
  backdrop-filter: blur(5px);
  opacity: 0;
  transition: opacity .2s;
}
.modal-card {
  position: relative;
  width: min(520px, 100%);
  max-height: 92vh;
  overflow-y: auto;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 24px;
  padding: 24px;
  box-shadow: var(--shadow);
  display: flex; flex-direction: column; gap: 15px;
  transform: translateY(14px) scale(.98);
  opacity: 0;
  transition: transform .22s cubic-bezier(.2, .7, .2, 1), opacity .2s;
}
.modal.open .modal-backdrop { opacity: 1; }
.modal.open .modal-card { transform: none; opacity: 1; }

.modal-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.modal-head h3 { font-size: 20px; }

.modal-foot { display: flex; align-items: center; gap: 9px; margin-top: 4px; }
.modal-foot .spacer { flex: 1; }

.type-switch {
  display: inline-flex;
  gap: 4px;
  align-self: flex-start;
  padding: 4px;
  border-radius: 13px;
  background: var(--surface-3);
}
.type-btn {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  border: 0;
  background: transparent;
  border-radius: 10px;
  padding: 9px 16px;
  font-size: 13px;
  font-weight: 800;
  color: var(--muted);
  transition: background .18s, color .18s, box-shadow .18s;
}
.type-btn .icon { width: 16px; height: 16px; }
.type-btn:hover { color: var(--ink); }
.type-btn.active { background: var(--surface); color: var(--ink); box-shadow: var(--shadow-sm); }
.type-btn.active .icon { color: var(--accent); }
.type-hint { font-size: 12px; font-weight: 600; color: var(--muted); }

.prio-picker { display: grid; grid-template-columns: repeat(4, 1fr); gap: 7px; }
.prio {
  border: 1.5px solid var(--line);
  background: var(--surface-2);
  border-radius: 11px;
  padding: 9px 4px;
  font-size: 11.5px; font-weight: 800;
  color: var(--muted);
  transition: all .18s;
}
.prio::before {
  content: ""; display: inline-block;
  width: 7px; height: 7px; border-radius: 50%;
  margin-right: 5px; vertical-align: 1px;
  background: var(--pc, var(--muted));
}
.prio.low { --pc: #3fbf8f; }
.prio.medium { --pc: #5b8def; }
.prio.high { --pc: #f0a03c; }
.prio.urgent { --pc: var(--danger); }
.prio:hover { border-color: var(--line-strong); color: var(--ink); }
.prio.active { border-color: var(--pc); color: var(--ink); background: var(--surface); box-shadow: 0 0 0 3px color-mix(in srgb, var(--pc) 16%, transparent); }

.confirm-card { width: min(400px, 100%); text-align: center; align-items: center; }
.confirm-icon {
  width: 62px; height: 62px; border-radius: 20px;
  display: grid; place-items: center;
  background: var(--danger-soft); color: var(--danger);
  margin-bottom: 4px;
}
.confirm-icon .icon { width: 28px; height: 28px; }
.confirm-card h3 { font-size: 20px; }
.confirm-card p { color: var(--muted); font-size: 13.5px; font-weight: 600; overflow-wrap: anywhere; }
.confirm-card .modal-foot { width: 100%; justify-content: center; }

/* ---------- Тост ---------- */
.toasts {
  position: fixed; right: 18px; bottom: 18px; z-index: 200;
  display: flex; flex-direction: column; gap: 8px;
  max-width: min(380px, calc(100vw - 36px));
}
.toast {
  display: flex; align-items: center; gap: 10px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-left: 3px solid var(--accent);
  border-radius: 13px;
  padding: 11px 13px;
  box-shadow: var(--shadow);
  font-size: 13px; font-weight: 700;
  animation: toastIn .28s cubic-bezier(.2, .7, .2, 1) both;
}
.toast.out { animation: toastOut .2s ease forwards; }
.toast .icon { width: 17px; height: 17px; color: var(--accent); }
.toast.ok { border-left-color: var(--ok); }
.toast.ok .icon { color: var(--ok); }
.toast.error { border-left-color: var(--danger); }
.toast.error .icon { color: var(--danger); }
.toast-action {
  margin-left: auto; border: 0; background: var(--accent-soft);
  color: var(--accent); font-weight: 800; font-size: 12px;
  padding: 5px 10px; border-radius: 8px; white-space: nowrap;
}

/* ---------- Анимации ---------- */
@keyframes rise { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: none; } }
@keyframes pulse { 0%, 100% { opacity: 1; } 50% { opacity: .45; } }
@keyframes shake { 0%, 100% { transform: none; } 25% { transform: translateX(-4px); } 75% { transform: translateX(4px); } }
@keyframes toastIn { from { opacity: 0; transform: translateY(8px) scale(.97); } to { opacity: 1; transform: none; } }
@keyframes toastOut { to { opacity: 0; transform: translateX(12px); } }
@keyframes confetti {
  0% { transform: translate(0, 0) rotate(0); opacity: 1; }
  100% { transform: translate(var(--dx), var(--dy)) rotate(var(--rot)); opacity: 0; }
}
.confetti {
  position: fixed; width: 7px; height: 7px; border-radius: 2px;
  pointer-events: none; z-index: 300;
  animation: confetti .85s cubic-bezier(.2, .6, .4, 1) forwards;
}

/* ---------- Скроллбар ---------- */
::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--line-strong); border-radius: 8px; border: 3px solid transparent; background-clip: content-box; }
::-webkit-scrollbar-thumb:hover { background: var(--muted); background-clip: content-box; }

/* ---------- Адаптив ---------- */
.scrim { display: none; }

@media (max-width: 1080px) {
  .auth { grid-template-columns: 1fr; }
  .auth-hero { min-height: 46vh; padding-bottom: 32px; }
  .hero-preview { display: none; }
  .hero-footer { display: none; }
  .auth-panel { padding: 26px 18px 48px; }
}

@media (max-width: 960px) {
  .app { grid-template-columns: 1fr; }
  .sidebar {
    position: fixed; left: 0; top: 0; bottom: 0;
    width: 286px; height: 100vh;
    transform: translateX(-105%);
    transition: transform .26s cubic-bezier(.2, .7, .2, 1);
    background: var(--surface);
    box-shadow: var(--shadow);
  }
  .sidebar.open { transform: none; }
  .menu-close { display: grid; }
  .menu-btn { display: grid; }
  .scrim {
    display: block; position: fixed; inset: 0; z-index: 35;
    background: rgba(10, 6, 12, .45);
    opacity: 0; pointer-events: none; transition: opacity .22s;
  }
  .scrim.show { opacity: 1; pointer-events: auto; }
  .main { padding-top: 18px; }
}

@media (max-width: 720px) {
  .auth-theme { top: 14px; right: 14px; }
  .auth-theme-btn { height: 38px; padding: 0 12px; font-size: 12.5px; }
  .auth-theme-pop { width: 238px; padding: 12px; }
  .stats { grid-template-columns: repeat(2, 1fr); }
  .stat { padding: 13px 14px; }
  .stat-value { font-size: 22px; }
  .week-head { flex-direction: column; align-items: flex-start; gap: 12px; }
  .week-tools { align-self: stretch; justify-content: space-between; gap: 10px; }
  .week-progress { justify-content: flex-start; }
  .week-strip { gap: 5px; }
  .day-btn { padding: 8px 3px; border-radius: 11px; }
  .day-name { font-size: 9px; }
  .day-num { font-size: 14px; }
  .day-meta { display: none; }
  .topbar { flex-wrap: wrap; }
  .top-actions { flex: 1 0 100%; order: 3; }
  .search { flex: 1; width: auto; }
  .btn-primary span { display: none; }
  .btn-primary { padding: 11px 14px; }
  .tasks-head { align-items: flex-start; flex-direction: column; }
  .task { grid-template-columns: 28px minmax(0, 1fr); }
  .task-actions { grid-column: 2; opacity: 1; transform: none; justify-content: flex-end; margin-top: 2px; }
  .task-actions .icon-btn { width: 32px; height: 32px; }
  .toasts { right: 12px; bottom: 12px; left: 12px; max-width: none; }
  .field-row { grid-template-columns: 1fr; }
  .prio-picker { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 420px) {
  .stat-label { font-size: 11px; }
  .chip { padding: 6px 10px; font-size: 11px; }
  .auth-hero { min-height: 40vh; }
  .hero-copy h1 { font-size: 36px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; }
  html { scroll-behavior: auto; }
}
