/* План работ для АльфаСтрахования: 12 месяцев → месяц → задачи; слева — задачи текущего месяца.
   Токены, шрифт TT Norms Pro, логотип и иконки (Lucide с allsvgicons.com) — как у справочника spravka.antonzakirov.ru.
   На компьютере сетка месяцев целиком помещается в экран (MacBook 13" и больше): плитки тянутся по высоте окна,
   цифры масштабируются по высоте плитки (единицы cqh). */

@font-face { font-family: "TT Norms Pro"; src: url(fonts/ttnorms-400.woff2) format("woff2"); font-weight: 400; font-display: swap; }
@font-face { font-family: "TT Norms Pro"; src: url(fonts/ttnorms-500.woff2) format("woff2"); font-weight: 500; font-display: swap; }
@font-face { font-family: "TT Norms Pro"; src: url(fonts/ttnorms-600.woff2) format("woff2"); font-weight: 600; font-display: swap; }

:root {
  --bg: #FFFFFF; --alt: #F6F6F8; --soft: #EDEDF3;
  --ink: #26262C; --ink-2: #3A3A40; --muted: #6B6B7B; --sub: #7C7C92;
  --line: #E4E4EA; --line-2: #C9C9D3;
  --red: #CE253D; --red-h: #B22034; --red-soft: #FBEBED; --red-ink: #CE253D;
  --shadow: 0 2px 6px rgba(38, 38, 44, .06), 0 24px 60px -24px rgba(38, 38, 44, .4);
  --font: "TT Norms Pro", "Segoe UI", system-ui, -apple-system, sans-serif;
  --hdr: 64px; --side: 320px;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #202025; --alt: #27272C; --soft: #323237; --ink: #F5F5F6; --ink-2: #CCCCD9; --muted: #9D9DAA; --sub: #8D8D92;
    --line: #34343B; --line-2: #4C4C57; --red-h: #E0334C; --red-soft: #3A1F25; --red-ink: #FF6B7F;
    --shadow: 0 2px 6px rgba(0, 0, 0, .3), 0 24px 60px -24px rgba(0, 0, 0, .8);
    color-scheme: dark;
  }
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; }
body { margin: 0; background: var(--bg); color: var(--ink); font: 400 16px/1.5 var(--font); -webkit-font-smoothing: antialiased; }
::selection { background: var(--red-soft); color: var(--ink); }
a { color: inherit; }
:focus-visible { outline: 2px solid var(--red); outline-offset: 2px; border-radius: 8px; }
h1, h2, p { margin: 0; }
h1, h2 { font-weight: 600; letter-spacing: -0.02em; text-wrap: balance; }
button, input, select, textarea { font: inherit; color: inherit; }
.i { width: 20px; height: 20px; flex: none; }

/* ——— шапка ——— */
.hdr { position: sticky; top: 0; z-index: 30; background: var(--bg); border-bottom: 1px solid var(--line); }
.hdr-in { height: calc(var(--hdr) - 1px); display: flex; align-items: center; gap: 24px; padding: 0 24px; }
.brand { display: flex; align-items: center; gap: 16px; text-decoration: none; flex: none; min-width: 0; }
.logo { height: 32px; width: auto; display: block; }
.brand-t { padding-left: 16px; border-left: 1px solid var(--line); font-size: 15px; font-weight: 500; color: var(--muted); white-space: nowrap; }
.brand:hover .brand-t { color: var(--ink); }
.net { margin-left: auto; display: inline-flex; align-items: center; gap: 8px; font-size: 14px; color: var(--muted); white-space: nowrap; }
.net::before { content: ""; width: 8px; height: 8px; border-radius: 50%; background: var(--line-2); }
.net[data-s="ok"]::before { background: #2E9E5B; }
.net[data-s="saving"]::before { background: var(--sub); }
.net[data-s="err"] { color: var(--red-ink); }
.net[data-s="err"]::before { background: var(--red); }

/* ——— раскладка: слева месяц, справа план ——— */
.app { display: grid; grid-template-columns: var(--side) minmax(0, 1fr); }
.page { min-width: 0; padding: 28px 32px 32px; display: flex; flex-direction: column; }
.wrap { width: 100%; flex: 1 0 auto; display: flex; flex-direction: column; min-height: 0; }
.wrap.is-month { max-width: 920px; }
.wrap.is-month > * { flex: none; }

/* ——— слева: в этом месяце ——— */
.side { background: var(--alt); border-right: 1px solid var(--line); display: flex; flex-direction: column; min-height: 0; }
.s-head { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; padding: 28px 24px 12px; }
.s-t { font-size: 20px; line-height: 1.25; }
.s-mo { font-size: 15px; color: var(--muted); text-decoration: none; white-space: nowrap; }
.s-mo:hover { color: var(--red-ink); }
.s-list { flex: 1 1 auto; min-height: 0; overflow-y: auto; overscroll-behavior: contain; padding: 0 12px 12px;
  scrollbar-width: thin; scrollbar-color: var(--line-2) transparent; }
.mini { list-style: none; margin: 0; padding: 0; display: grid; gap: 2px; }
.mi { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; column-gap: 10px; align-items: start; padding: 9px 12px; border-radius: 12px; }
.mi:hover, .mi:focus-within { background: var(--soft); }
.mi-t { display: flex; align-items: flex-start; gap: 8px; min-width: 0; padding: 0; border: 0; background: none; text-align: left; cursor: pointer;
  font-size: 15px; line-height: 22px; font-weight: 500; color: var(--ink); }
.mi-t > span { overflow-wrap: anywhere; }
.mi-t:hover > span { color: var(--red-ink); }
.mi-k { width: 18px; height: 18px; margin-top: 1px; color: var(--muted); }
.mi-l { width: 22px; height: 22px; display: grid; place-items: center; color: var(--muted); border-radius: 6px; }
.mi-l:hover { color: var(--red-ink); }
.mi-l .i { width: 16px; height: 16px; }
.mi .chk { margin-top: -1px; }
.mi .lf { grid-column: 2 / -1; margin-top: 8px; }
.mi.done .mi-t > span { color: var(--muted); text-decoration: line-through; text-decoration-color: var(--line-2); }
.mi.done .mi-k { color: var(--line-2); }
.s-empty { padding: 4px 12px; font-size: 15px; color: var(--muted); }
.s-foot { flex: none; padding: 12px 24px 16px; }
.s-links { flex: none; display: grid; gap: 2px; padding: 12px 12px 20px; border-top: 1px solid var(--line); }
.s-link { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 8px 12px; border-radius: 10px;
  font-size: 15px; color: var(--ink-2); text-decoration: none; }
.s-link:hover { background: var(--soft); color: var(--ink); }
.s-link .i { width: 16px; height: 16px; color: var(--muted); }

/* ——— кнопки и галочка ——— */
.btn { height: 44px; padding: 0 20px; border-radius: 12px; border: 0; background: var(--red); color: #fff; font-size: 15px; font-weight: 500;
  display: inline-flex; align-items: center; justify-content: center; gap: 8px; cursor: pointer; white-space: nowrap; text-decoration: none; }
.btn:hover { background: var(--red-h); }
.btn .i { width: 18px; height: 18px; }
.btn.wide { width: 100%; }
.btn.ghost { background: var(--bg); color: var(--ink); box-shadow: inset 0 0 0 1px var(--line-2); }
.btn.ghost:hover { box-shadow: inset 0 0 0 1px var(--ink); }
.btn.quiet { background: none; color: var(--red-ink); padding: 0 12px; margin-left: auto; }
.btn.quiet:hover { background: var(--red-soft); }
.chk { width: 22px; height: 22px; border-radius: 7px; border: 1.5px solid var(--line-2); background: var(--bg); color: #fff;
  display: grid; place-items: center; cursor: pointer; padding: 0; flex: none; }
.chk:hover { border-color: var(--ink); }
.chk .i { width: 15px; height: 15px; opacity: 0; stroke-width: 3; }
.chk[aria-checked="true"] { background: var(--red); border-color: var(--red); }
.chk[aria-checked="true"] .i { opacity: 1; }
.tool { width: 34px; height: 34px; border: 0; border-radius: 10px; background: transparent; color: var(--muted); display: grid; place-items: center; cursor: pointer; padding: 0; flex: none; }
.tool:hover { background: var(--soft); color: var(--ink); }
.tool .i { width: 18px; height: 18px; }

/* ——— заголовок страницы ——— */
.top { display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between; gap: 12px 24px; }
.top-l { display: grid; gap: 6px; min-width: 0; }
.top h1 { font-size: 36px; line-height: 1.1; }
.top-sub { font-size: 16px; color: var(--muted); }
.top-r { display: flex; flex-wrap: wrap; align-items: center; gap: 12px 16px; }
.crumbs { align-self: flex-start; display: inline-flex; align-items: center; gap: 6px; margin-bottom: 20px; font-size: 15px; color: var(--muted); text-decoration: none; }
.crumbs:hover { color: var(--red-ink); }
.crumbs .i { width: 16px; height: 16px; }
.nd { font-size: 15px; color: var(--muted); text-decoration: none; }
.nd:hover { color: var(--red-ink); }
.step { display: flex; gap: 8px; }
.is-year .top-r { margin-bottom: 1px; }
.ibtn { width: 40px; height: 40px; border-radius: 12px; box-shadow: inset 0 0 0 1px var(--line-2); background: var(--bg); color: var(--ink);
  display: grid; place-items: center; text-decoration: none; }
.ibtn:hover { box-shadow: inset 0 0 0 1px var(--ink); }
.ibtn .i { width: 18px; height: 18px; }
.ibtn.l .i { transform: rotate(90deg); }
.ibtn.r .i { transform: rotate(-90deg); }

/* ——— 12 месяцев ——— */
.months { margin-top: 24px; display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); grid-auto-rows: 136px; gap: 12px; }
.mo { container-type: size; min-width: 0; display: flex; flex-direction: column; justify-content: space-between; padding: 16px 20px 18px;
  border-radius: 20px; background: var(--alt); color: var(--ink); text-decoration: none; transition: background-color .15s; }
.mo:hover { background: var(--soft); }
.mo:focus-visible { outline-offset: 3px; border-radius: 20px; }
.mo.cur { box-shadow: inset 0 0 0 2px var(--red); }
.mo-name { font-size: clamp(15px, 13cqh, 20px); font-weight: 500; line-height: 1.2; letter-spacing: -0.01em; }
.mo-b { display: grid; gap: clamp(4px, 4cqh, 10px); }
.mo-num { font-size: clamp(30px, 44cqh, 96px); font-weight: 600; line-height: .86; letter-spacing: -0.04em; font-variant-numeric: tabular-nums; }
.mo.zero .mo-num { color: var(--line-2); }
.mo-done { font-size: clamp(13px, 9.5cqh, 16px); line-height: 1.2; color: var(--muted); }

/* ——— месяц: список задач ——— */
.list { list-style: none; margin: 24px 0 0; padding: 0; border-top: 1px solid var(--line); }
.task { display: grid; grid-template-columns: auto auto minmax(0, 1fr) auto; column-gap: 12px; align-items: start; padding: 18px 0; border-bottom: 1px solid var(--line); }
.task .chk { margin-top: 0; }
.t-k { width: 20px; height: 20px; margin-top: 1px; color: var(--muted); }
.t-b { display: grid; gap: 6px; min-width: 0; }
.t-t { font-size: 17px; line-height: 24px; font-weight: 500; overflow-wrap: anywhere; }
.t-n { font-size: 15px; line-height: 1.5; color: var(--ink-2); overflow-wrap: anywhere; max-width: 68ch; }
.t-m { display: flex; flex-wrap: wrap; gap: 4px 14px; font-size: 14px; color: var(--muted); }
.late { color: var(--red-ink); font-weight: 500; }
.task.done .t-t { color: var(--muted); text-decoration: line-through; text-decoration-color: var(--line-2); text-decoration-thickness: 1px; }
.task.done .t-n { color: var(--muted); }
.task.done .t-k { color: var(--line-2); }
.t-a { display: flex; align-items: center; gap: 4px; margin-top: -6px; }
.lnk { height: 34px; padding: 0 12px; border-radius: 10px; box-shadow: inset 0 0 0 1px var(--line-2); background: var(--bg); font-size: 14px; font-weight: 500;
  display: inline-flex; align-items: center; gap: 6px; text-decoration: none; white-space: nowrap; }
.lnk:hover { box-shadow: inset 0 0 0 1px var(--ink); }
.lnk .i { width: 15px; height: 15px; color: var(--muted); }
@media (hover: hover) and (pointer: fine) {
  .task .tool { opacity: 0; }
  .task:hover .tool, .task:focus-within .tool { opacity: 1; }
}
.sec-t { margin-top: 40px; font-size: 20px; line-height: 1.25; }
.sec-t + .list { margin-top: 12px; }
.empty { margin-top: 24px; padding: 40px 24px; border-radius: 16px; background: var(--alt); color: var(--muted); text-align: center; }

/* ——— поле ссылки у выполненной задачи ——— */
.lf { display: flex; gap: 8px; max-width: 520px; margin-top: 4px; }
.lf .inp { height: 38px; padding: 0 12px; border-radius: 10px; font-size: 15px; }
.lf .btn { height: 38px; padding: 0 16px; border-radius: 10px; font-size: 14px; }
.lf .btn.ic { width: 38px; padding: 0; }
.lf .btn.ic .i { width: 16px; height: 16px; stroke-width: 2.5; }

/* ——— поля ——— */
.inp { width: 100%; min-width: 0; height: 46px; padding: 0 14px; border-radius: 12px; border: 1px solid var(--line-2); background: var(--bg);
  color: var(--ink); font-size: 16px; outline: none; -webkit-appearance: none; appearance: none; caret-color: var(--red); }
.inp::placeholder { color: var(--sub); }
.inp:hover { border-color: var(--muted); }
.inp:focus { border-color: var(--ink); box-shadow: 0 0 0 4px var(--red-soft); }
.inp[aria-invalid="true"] { border-color: var(--red); }
textarea.inp { height: auto; min-height: 84px; padding: 11px 14px; line-height: 1.45; resize: vertical; }
select.inp { padding-right: 36px; background-image: linear-gradient(45deg, transparent 50%, var(--muted) 50%), linear-gradient(135deg, var(--muted) 50%, transparent 50%);
  background-position: calc(100% - 19px) 20px, calc(100% - 14px) 20px; background-size: 5px 5px; background-repeat: no-repeat; cursor: pointer; }

/* ——— окно задачи ——— */
.dlg { width: min(560px, calc(100vw - 32px)); max-width: none; max-height: calc(100dvh - 32px); padding: 0; border: 0; border-radius: 20px;
  background: var(--bg); color: var(--ink); box-shadow: var(--shadow); overflow-y: auto; overscroll-behavior: contain; }
.dlg::backdrop { background: rgba(20, 20, 26, .42); }
.tform { padding: 24px; display: grid; gap: 18px; }
.d-h { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin: -4px -8px -2px 0; }
.d-h h2 { font-size: 22px; line-height: 1.25; }
.fld { display: grid; gap: 6px; min-width: 0; }
.fld > span { font-size: 14px; font-weight: 500; color: var(--muted); }
.seg { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 4px; padding: 4px; border-radius: 12px; background: var(--alt); }
.seg label { position: relative; }
.seg input { position: absolute; opacity: 0; inset: 0; margin: 0; cursor: pointer; }
.seg span { height: 40px; display: flex; align-items: center; justify-content: center; gap: 8px; border-radius: 9px; padding: 0 8px;
  font-size: 15px; font-weight: 500; color: var(--muted); white-space: nowrap; }
.seg span .i { width: 18px; height: 18px; }
.seg label:hover span { color: var(--ink); }
.seg input:checked + span { background: var(--bg); color: var(--ink); box-shadow: 0 1px 2px rgba(38, 38, 44, .1), inset 0 0 0 1px var(--line); }
.seg input:focus-visible + span { outline: 2px solid var(--red); outline-offset: 1px; }
.cb { position: relative; justify-self: start; display: inline-flex; align-items: center; gap: 10px; font-size: 16px; font-weight: 500; cursor: pointer; }
.cb input { position: absolute; opacity: 0; width: 22px; height: 22px; margin: 0; cursor: pointer; }
.cb-box { width: 22px; height: 22px; border-radius: 7px; border: 1.5px solid var(--line-2); background: var(--bg); color: #fff; display: grid; place-items: center; }
.cb-box .i { width: 15px; height: 15px; opacity: 0; stroke-width: 3; }
.cb:hover .cb-box { border-color: var(--ink); }
.cb input:checked + .cb-box { background: var(--red); border-color: var(--red); }
.cb input:checked + .cb-box .i { opacity: 1; }
.cb input:focus-visible + .cb-box { outline: 2px solid var(--red); outline-offset: 2px; }
.f-a { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 4px; }
@media (max-height: 760px) {
  .tform { padding: 20px 24px; gap: 14px; }
  .seg span { height: 36px; }
  textarea.inp { min-height: 72px; }
}

/* ——— компьютер: всё в один экран, колонки прокручиваются сами по себе ——— */
@media (min-width: 1000px) {
  .app { height: calc(100vh - var(--hdr)); height: calc(100dvh - var(--hdr)); }
  .page { overflow-y: auto; overscroll-behavior: contain; scrollbar-width: thin; scrollbar-color: var(--line-2) transparent; }
}
@media (min-width: 1000px) and (min-height: 560px) {
  .is-year .months { flex: 1 0 auto; grid-template-rows: repeat(3, minmax(110px, 1fr)); grid-auto-rows: auto; }
}
@media (max-width: 1279px) { :root { --side: 288px; } .page { padding: 24px 24px 28px; } }

/* ——— планшет и телефон: план сверху, задачи месяца под ним ——— */
@media (max-width: 999px) {
  .app { grid-template-columns: minmax(0, 1fr); }
  .side { order: 2; border-right: 0; border-top: 1px solid var(--line); }
  .s-head { padding: 28px 24px 8px; }
  .s-list { overflow: visible; }
  .page { padding: 28px 24px 36px; }
  .months { grid-template-columns: repeat(3, minmax(0, 1fr)); grid-auto-rows: 132px; gap: 10px; }
}
@media (max-width: 599px) {
  .hdr-in { padding: 0 16px; gap: 12px; }
  .logo { height: 28px; }
  .brand { gap: 12px; }
  .brand-t { padding-left: 12px; font-size: 14px; }
  .net { font-size: 0; gap: 0; }
  .page { padding: 20px 16px 28px; }
  .top h1 { font-size: 28px; }
  .top .btn { height: 40px; padding: 0 16px; }
  .ibtn { width: 40px; height: 40px; }
  .months { margin-top: 18px; gap: 8px; grid-auto-rows: 112px; }
  .mo { padding: 12px 14px 14px; border-radius: 16px; }
  .mo:focus-visible { border-radius: 16px; }
  .s-head { padding: 24px 16px 8px; }
  .s-list { padding: 0 4px 8px; }
  .s-foot { padding: 8px 16px 16px; }
  .s-links { padding: 10px 4px 20px; }
  .task { grid-template-columns: auto auto minmax(0, 1fr); column-gap: 10px; padding: 16px 0; }
  .t-a { grid-column: 3; margin-top: 8px; flex-wrap: wrap; }
  .lf .btn:not(.ic) { padding: 0 12px; }
  .dlg { width: calc(100vw - 16px); max-height: calc(100dvh - 16px); border-radius: 18px; }
  .tform { padding: 20px 16px; gap: 16px; }
  .seg span { font-size: 14px; gap: 6px; padding: 0 4px; }
  .f-a .btn { flex: 1 1 auto; }
  .btn.quiet { margin-left: 0; }
}
@media (max-width: 419px) {
  .months { gap: 6px; }
  .mo { padding: 10px 10px 12px; border-radius: 14px; }
  .mo-done { font-size: 12px; letter-spacing: -0.01em; }
}
@media (max-width: 359px) {
  .brand-t { display: none; }
  .months { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .seg span .i { display: none; }
}
