/* ==================== Планер: месяц / квартал (month-overview.js) ====================
   Компактный календарь (как мини-календарь недели и годовая карта) + сводка периода.
   Бэклог и итоги — шторки по кнопкам, в раскладке месяца их нет. */

#monthView, .mo-drawer {
    --mo-line: var(--color-border, rgba(148, 163, 184, 0.22));
    --mo-card: var(--color-bg-card, #fff);
    --mo-solid: var(--color-bg-solid, var(--color-bg-card, #fff));
    --mo-soft: var(--color-bg-secondary, rgba(148, 163, 184, 0.08));
    --mo-text: var(--color-text-primary, #111827);
    --mo-muted: var(--color-text-secondary, #64748b);
    --mo-accent: var(--color-primary, #f0937a);
    --mo-ok: var(--color-success, #22c55e);
    --mo-bad: #ef4444;
}

/* раскладка старого месяца (3 колонки с панелями) больше не нужна */
#monthView.month-workspace { display: block; }
#monthView .month-side { display: none; }
#monthView .month-grid-large { border: 0; background: none; overflow: visible; }

.mo { display: grid; gap: 12px; color: var(--mo-text); min-width: 0; }
.mo *, .mo *::before, .mo *::after { box-sizing: border-box; }

/* ---------- верхняя строка ---------- */
.mo-bar-top { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.mo-seg { display: inline-flex; padding: 3px; border-radius: 999px; background: var(--mo-soft); border: 1px solid var(--mo-line); }
.mo-seg button {
    height: 30px; padding: 0 14px; border: 0; border-radius: 999px; background: none;
    color: var(--mo-muted); font: inherit; font-size: 13.5px; font-weight: 600; cursor: pointer;
}
.mo-seg button.is-active { background: var(--mo-card); color: var(--mo-text); box-shadow: 0 1px 3px rgba(0, 0, 0, 0.2); }
.mo-title { margin: 0; font-size: 20px; font-weight: 700; }
.mo-title small { font-size: 14px; font-weight: 500; color: var(--mo-muted); margin-left: 4px; }
.mo-actions { display: flex; gap: 6px; margin-left: auto; }
.mo-btn {
    display: inline-flex; align-items: center; gap: 6px; height: 34px; padding: 0 12px;
    border-radius: 999px; border: 1px solid var(--mo-line); background: var(--mo-card); color: var(--mo-text);
    font: inherit; font-size: 13.5px; font-weight: 600; cursor: pointer; white-space: nowrap;
}
.mo-btn:hover { border-color: var(--mo-accent); }
.mo-btn small { padding: 1px 7px; border-radius: 999px; background: var(--mo-soft); color: var(--mo-muted); font-size: 11.5px; }

/* ---------- тело: календари + сводка ----------
   Области: календарь (cal), цифры (stats), недели (weeks), цели (goals), выводы (insights).
   Компьютер — календарь крупно слева на всю высоту; планшет — цели и выводы во всю
   ширину под календарём; телефон — столбиком. */
.mo-body {
    display: grid;
    gap: 12px;
    align-items: start;
    min-width: 0;
    grid-template-columns: minmax(0, 1fr);
    grid-template-areas: "cal" "stats" "weeks" "goals" "insights";
}
.mo-a-cal { grid-area: cal; }
.mo-a-stats { grid-area: stats; }
.mo-a-weeks { grid-area: weeks; }
.mo-a-goals { grid-area: goals; }
.mo-a-insights { grid-area: insights; }
.mo-body > * { min-width: 0; }
@media (min-width: 640px) and (max-width: 899px) {
    .mo-body {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        grid-template-areas: "cal cal" "stats weeks" "goals goals" "insights insights";
    }
    .mo-a-stats, .mo-a-weeks { align-self: stretch; }
}
@media (min-width: 900px) {
    .mo-body {
        grid-template-columns: minmax(0, 1.15fr) minmax(300px, 1fr);
        grid-template-areas: "cal stats" "cal weeks" "goals goals" "insights insights";
        grid-template-rows: auto 1fr auto auto;
    }
    .mo-a-weeks { align-self: stretch; }
}
@media (min-width: 1280px) {
    .mo-body {
        grid-template-columns: minmax(0, 1.4fr) minmax(340px, 1fr);
        grid-template-areas: "cal stats" "cal weeks" "cal goals" "cal insights";
        grid-template-rows: auto auto auto 1fr;
    }
    .mo-a-weeks { align-self: start; }
    .mo-a-cal { position: sticky; top: 12px; }
    .mo-body.is-quarter .mo-a-cal { position: static; }
}
.mo-cals { display: grid; gap: 12px; min-width: 0; }
/* ---------- квартал: три компактных месяца слева, вся сводка — сбоку, без прокрутки ---------- */
@media (min-width: 900px) {
    .mo-body.is-quarter {
        grid-template-columns: minmax(0, 1fr) minmax(320px, 1fr);
        grid-template-areas: "cal stats" "cal weeks" "cal goals" "cal insights";
        grid-template-rows: auto auto auto 1fr;
    }
    .mo-body.is-quarter .mo-a-weeks { align-self: start; }
    .mo-body.is-quarter .mo-cals { gap: 8px; }
    .mo-body.is-quarter .mo-cal { padding: 8px 10px 10px; }
    .mo-body.is-quarter .mo-cal-head { margin-bottom: 4px; }
    .mo-body.is-quarter .mo-cal-title { font-size: 14px; }
    .mo-body.is-quarter .mo-grid { gap: 2px 3px; grid-template-columns: 22px repeat(7, minmax(0, 1fr)); }
    .mo-body.is-quarter .mo-dow { padding-bottom: 0; font-size: 10px; }
    /* высота клетки — от высоты окна: 3 месяца ≈ 16 строк недель + шапки месяцев и страницы (~450px) */
    .mo-body.is-quarter { --mo-qrow: clamp(27px, calc((100vh - 452px) / 16), 54px); }
    .mo-body.is-quarter .mo-day { aspect-ratio: auto; height: var(--mo-qrow); min-height: 0; border-radius: 8px; gap: 1px; }
    .mo-body.is-quarter .mo-legend { display: none; } /* легенда есть в режиме «Месяц» — здесь важнее высота */
    .mo-body.is-quarter .mo-num { font-size: clamp(12px, calc(var(--mo-qrow) * 0.34), 16px); }
    .mo-body.is-quarter .mo-cnt { font-size: clamp(9px, calc(var(--mo-qrow) * 0.24), 12px); }
        /* сводка квартала плотнее, чтобы встала рядом с тремя месяцами */
    .mo-body.is-quarter .mo-card { padding: 10px 12px; }
    .mo-body.is-quarter .mo-card h3 { margin-bottom: 6px; }
    .mo-body.is-quarter .mo-kpis { grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 4px; }
    .mo-body.is-quarter .mo-kpi { padding: 6px 7px; }
    .mo-body.is-quarter .mo-kpi span { font-size: 10.5px; }
    .mo-body.is-quarter .mo-kpi b { font-size: 17px; }
    .mo-body.is-quarter .mo-weeks { gap: 1px; }
    .mo-body.is-quarter .mo-week { font-size: 11px; line-height: clamp(15px, calc(var(--mo-qrow) * 0.6), 26px); }
    .mo-body.is-quarter .mo-bar { height: 5px; }
    .mo-body.is-quarter .mo-goals { grid-template-columns: minmax(0, 1fr); gap: 8px; }
}


/* ---------- календарь ---------- */
.mo-cal { padding: 12px; border-radius: 16px; background: var(--mo-card); border: 1px solid var(--mo-line); }
.mo-cal.is-current { border-color: color-mix(in srgb, var(--mo-accent) 45%, var(--mo-line)); }
.mo-cal-head { display: flex; align-items: baseline; justify-content: space-between; gap: 8px; margin: 0 2px 8px; }
.mo-cal-title { padding: 0; border: 0; background: none; color: var(--mo-text); font: inherit; font-size: 15px; font-weight: 700; cursor: pointer; }
.mo-cal-title:hover { color: var(--mo-accent); }
.mo-cal-sum { font-size: 12.5px; color: var(--mo-muted); font-weight: 600; }

.mo-grid { display: grid; grid-template-columns: 26px repeat(7, minmax(0, 1fr)); gap: 4px; }
.mo-dow { padding-bottom: 2px; font-size: 11px; font-weight: 600; color: var(--mo-muted); text-align: center; }
.mo-dow-wk { opacity: 0.6; }
.mo-wk { display: grid; place-items: center; font-size: 10.5px; font-weight: 600; color: var(--mo-muted); opacity: 0.7; }
.mo-day {
    position: relative; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px;
    aspect-ratio: 1 / 0.86; min-height: 34px; padding: 0; margin: 0;
    border: 0; border-radius: 10px; background: var(--mo-soft); color: var(--mo-text);
    font: inherit; cursor: pointer; transition: box-shadow 0.12s;
}
.mo-day:hover { box-shadow: 0 0 0 1.5px var(--mo-accent); }
.mo-day.is-empty { background: none; cursor: default; box-shadow: none; }
.mo-day.is-weekend .mo-num { color: var(--mo-muted); }
.mo-num { font-size: 13.5px; font-weight: 600; line-height: 1; }
@media (min-width: 1280px) {
    .mo-body:not(.is-quarter) .mo-day { aspect-ratio: 1 / 0.74; border-radius: 12px; }
    .mo-body:not(.is-quarter) .mo-num { font-size: 17px; }
    .mo-body:not(.is-quarter) .mo-cnt { font-size: 12px; }
    .mo-body:not(.is-quarter) .mo-grid { gap: 6px; grid-template-columns: 30px repeat(7, minmax(0, 1fr)); }
    .mo-body:not(.is-quarter) .mo-cal { padding: 16px; }
}
.mo-cnt { font-size: 10px; font-weight: 600; line-height: 1; color: var(--mo-muted); font-variant-numeric: tabular-nums; }
/* результат прошлого дня — зелёная шкала, будущее — шкала загрузки (как годовая карта) */
.mo-day.done-0 { background: color-mix(in srgb, var(--mo-bad) 16%, var(--mo-soft)); }
.mo-day.done-1 { background: color-mix(in srgb, var(--mo-ok) 20%, var(--mo-soft)); }
.mo-day.done-2 { background: color-mix(in srgb, var(--mo-ok) 36%, var(--mo-soft)); }
.mo-day.done-3 { background: color-mix(in srgb, var(--mo-ok) 56%, var(--mo-soft)); }
.mo-day.done-4 { background: color-mix(in srgb, var(--mo-ok) 80%, var(--mo-soft)); }
.mo-day.done-3 .mo-cnt, .mo-day.done-4 .mo-cnt, .mo-day.done-4 .mo-num { color: #fff; }
.mo-day.is-untouched { background: repeating-linear-gradient(135deg, var(--mo-soft) 0 5px, color-mix(in srgb, var(--mo-muted) 14%, var(--mo-soft)) 5px 7px); }
.mo-day.load-1 { background: color-mix(in srgb, var(--mo-accent) 12%, var(--mo-soft)); }
.mo-day.load-2 { background: color-mix(in srgb, var(--mo-accent) 24%, var(--mo-soft)); }
.mo-day.load-3 { background: color-mix(in srgb, var(--mo-accent) 40%, var(--mo-soft)); }
.mo-day.load-4 { background: color-mix(in srgb, var(--mo-accent) 58%, var(--mo-soft)); }
.mo-day.is-today { box-shadow: 0 0 0 2px var(--mo-accent); }
.mo-day.is-today .mo-num { color: var(--mo-accent); font-weight: 800; }
.mo-day.done-4.is-today .mo-num { color: #fff; }
.mo-day.is-drop-target { outline: 2px dashed var(--mo-accent); outline-offset: 1px; }

.mo-legend { display: flex; flex-wrap: wrap; gap: 6px 14px; padding: 0 4px; font-size: 11.5px; color: var(--mo-muted); }
.mo-legend .year-legend-group { display: inline-flex; align-items: center; gap: 5px; }
.mo-legend .year-legend-scale { display: inline-flex; align-items: center; gap: 2px; }
.mo-legend .year-legend-swatch { width: 11px; height: 11px; border-radius: 3px; }

/* ---------- сводка ---------- */
.mo-card { padding: 12px 14px; border-radius: 16px; background: var(--mo-card); border: 1px solid var(--mo-line); min-width: 0; }
.mo-card h3 { margin: 0 0 8px; font-size: 14px; font-weight: 700; }
.mo-card-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-bottom: 6px; }
.mo-card-head h3 { margin: 0; }
.mo-link { border: 0; background: none; padding: 2px 4px; color: var(--mo-accent); font: inherit; font-size: 13px; font-weight: 600; cursor: pointer; }
.mo-empty { font-size: 13px; color: var(--mo-muted); }

.mo-kpis { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 6px; }
@media (min-width: 1800px) { .mo-kpis { grid-template-columns: repeat(6, minmax(0, 1fr)); } }
.mo-kpi { padding: 8px 10px; border-radius: 12px; background: var(--mo-soft); min-width: 0; }
.mo-kpi b { display: block; font-size: 19px; line-height: 1.1; font-variant-numeric: tabular-nums; }
.mo-kpi span { display: block; margin-top: 2px; font-size: 11.5px; color: var(--mo-muted); line-height: 1.2; }
.mo-kpi.is-main b { color: var(--mo-accent); }
.mo-kpi.is-ok b { color: var(--mo-ok); }
.mo-kpi.is-bad b { color: var(--mo-bad); }

.mo-weeks { display: grid; gap: 5px; }
.mo-week { display: grid; grid-template-columns: 34px minmax(0, 1fr) 52px; align-items: center; gap: 8px; font-size: 12px; }
.mo-week.is-now .mo-week-n { color: var(--mo-accent); }
.mo-week-n { font-weight: 700; color: var(--mo-muted); }
.mo-week-v { text-align: right; color: var(--mo-muted); font-variant-numeric: tabular-nums; }
.mo-bar { display: flex; height: 8px; border-radius: 999px; background: var(--mo-soft); overflow: hidden; }
.mo-bar-done { background: var(--mo-ok); }
.mo-bar-miss { background: color-mix(in srgb, var(--mo-bad) 70%, transparent); }

.mo-goals { display: grid; gap: 10px 24px; grid-template-columns: repeat(auto-fill, minmax(min(100%, 320px), 1fr)); }
.mo-goals > *, .mo-goal-top { min-width: 0; }
.mo-goals-note { margin: -2px 0 8px; font-size: 12px; }
.mo-goal { --goal: var(--mo-accent); display: grid; gap: 4px; color: inherit; text-decoration: none; }
.mo-goal:hover .mo-goal-title { color: var(--goal); }
.mo-goal-top { display: flex; align-items: baseline; justify-content: space-between; gap: 8px; }
.mo-goal-title { font-size: 13.5px; font-weight: 600; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.mo-goal-pct { font-size: 12.5px; font-weight: 700; color: var(--mo-muted); font-variant-numeric: tabular-nums; }
.mo-goal .mo-bar { height: 6px; }
.mo-goal .mo-bar-done { background: var(--goal); }
.mo-goal-sub { font-size: 11.5px; color: var(--mo-muted); }
.mo-idle { font-weight: 600; color: #f59e0b; }
.mo-insights {
    margin: 0; font-size: 13.5px; line-height: 1.45; white-space: pre-line;
    display: -webkit-box; -webkit-line-clamp: 6; -webkit-box-orient: vertical; overflow: hidden;
}

/* ---------- шторки: бэклог и итоги ---------- */
.mo-drawer-backdrop { position: fixed; inset: 0; z-index: 10040; background: rgba(2, 6, 23, 0.45); }
.mo-drawer-backdrop[hidden] { display: none; }
.mo-drawer {
    position: fixed; top: 0; right: 0; bottom: 0; z-index: 10050;
    width: min(420px, 100vw); display: flex; flex-direction: column;
    background: var(--mo-solid); color: var(--mo-text);
    border-left: 1px solid var(--mo-line); box-shadow: -12px 0 40px rgba(0, 0, 0, 0.3);
    transform: translateX(100%); transition: transform 0.22s ease;
}
.mo-drawer.is-open { transform: none; }
.mo-drawer[hidden] { display: none; }
.mo-drawer-head {
    display: flex; align-items: center; justify-content: space-between; gap: 8px;
    padding: max(14px, env(safe-area-inset-top, 0px)) 16px 10px;
    border-bottom: 1px solid var(--mo-line); font-size: 16px;
}
.mo-drawer-x { width: 32px; height: 32px; padding: 0; border: 0; border-radius: 50%; background: var(--mo-soft); color: var(--mo-text); font-size: 20px; line-height: 1; cursor: pointer; }
.mo-drawer .month-side {
    display: block; position: static; flex: 1; max-height: none; overflow-y: auto; margin: 0;
    padding: 12px 16px calc(16px + env(safe-area-inset-bottom, 0px));
    border: 0; border-radius: 0; background: none;
}
/* в шторке своя кнопка закрытия — створки сворачивания панели прячем */
.mo-drawer .wg-sidebar-top, .mo-drawer .month-side-rail { display: none; }
.mo-drawer .month-summary { background: none; border: 0; box-shadow: none; padding: 0; margin: 0; }
.mo-drawer .month-summary-header { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-bottom: 10px; }
.mo-drawer .month-summary-header h2 { display: none; }
.mo-drawer .month-summary-header .btn { margin-left: auto; min-height: 34px; padding: 6px 16px; font-size: 13.5px; }
.mo-drawer .month-summary-insights label { display: block; margin-bottom: 4px; font-size: 12px; font-weight: 600; color: var(--mo-muted); }
.mo-drawer .month-summary textarea { width: 100%; min-height: 140px; margin: 0; padding: 10px 12px; border-radius: 12px; font-size: 14.5px; resize: vertical; }
.mo-drawer .month-summary-lists { display: grid; grid-template-columns: 1fr; gap: 4px; }
.mo-drawer .summary-list h3, .mo-drawer .month-summary-github h3 { font-size: 13px; margin: 12px 0 4px; }
.mo-drawer .summary-items .no-data { margin: 0; padding: 2px 0 4px; font-size: 12.5px; text-align: left; color: var(--mo-muted); }
.mo-drawer .github-analysis-controls { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.mo-drawer .github-analysis-controls select,
.mo-drawer .github-analysis-controls input { margin: 0; min-width: 0; max-width: 100%; flex: 1 1 140px; height: 34px; font-size: 13px; }
.mo-drawer .github-analysis-model-wrap { display: flex; flex-wrap: wrap; gap: 4px; flex: 1 1 100%; min-width: 0; }
.mo-drawer .github-analysis-model-chip { padding: 3px 10px; font-size: 12px; border-radius: 999px; }
body.mo-drawer-open { overflow: hidden; }

/* ---------- телефон ---------- */
@media (max-width: 640px) {
    .mo-bar-top { gap: 8px; }
    .mo-title { font-size: 18px; flex: 1 1 auto; }
    .mo-actions { margin-left: 0; width: 100%; }
    .mo-actions .mo-btn { flex: 1; justify-content: center; }
    .mo-cal { padding: 10px 8px; }
    .mo-grid { grid-template-columns: 20px repeat(7, minmax(0, 1fr)); gap: 3px; }
    .mo-day { border-radius: 8px; min-height: 38px; }
    .mo-num { font-size: 13px; }
    .mo-kpi b { font-size: 17px; }
    /* шторка — снизу */
    .mo-drawer {
        top: auto; left: 0; width: 100vw; height: 88vh;
        border-left: 0; border-top: 1px solid var(--mo-line); border-radius: 18px 18px 0 0;
        transform: translateY(100%);
    }
    .mo-drawer-head { padding-top: 14px; }
}

/* ==================== Год: аналитика и итоги (year-overview.js) ==================== */
#yearView, .yo-drawer {
    --mo-line: var(--color-border, rgba(148, 163, 184, 0.22));
    --mo-card: var(--color-bg-card, #fff);
    --mo-solid: var(--color-bg-solid, var(--color-bg-card, #fff));
    --mo-soft: var(--color-bg-secondary, rgba(148, 163, 184, 0.08));
    --mo-text: var(--color-text-primary, #111827);
    --mo-muted: var(--color-text-secondary, #64748b);
    --mo-accent: var(--color-primary, #f0937a);
    --mo-ok: var(--color-success, #22c55e);
    --mo-bad: #ef4444;
}
.year-grid.yo-host { display: block; padding: 0; background: none; border: 0; box-shadow: none; }
.yo .yo-months.year-grid-calendar { padding: 0; background: none; border: 0; box-shadow: none; }
.yo-body {
    display: grid;
    gap: 12px;
    align-items: start;
    min-width: 0;
    grid-template-columns: minmax(0, 1fr);
    grid-template-areas: "cal" "stats" "quarters" "months" "goals" "summary";
}
.yo-body > * { min-width: 0; }
.yo-a-cal { grid-area: cal; }
.yo-a-stats { grid-area: stats; }
.yo-a-quarters { grid-area: quarters; }
.yo-a-months { grid-area: months; }
.yo-a-goals { grid-area: goals; }
.yo-a-summary { grid-area: summary; }
@media (min-width: 900px) {
    .yo-body {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        grid-template-areas: "cal cal" "stats quarters" "months months" "goals summary";
    }
    .yo-a-stats, .yo-a-quarters, .yo-a-goals, .yo-a-summary { align-self: stretch; }
}
@media (min-width: 1280px) {
    .yo-body {
        grid-template-columns: minmax(0, 1.3fr) minmax(340px, 1fr);
        grid-template-areas: "cal stats" "cal quarters" "cal months" "cal goals" "cal summary";
        grid-template-rows: auto auto auto auto 1fr;
    }
    .yo-a-stats, .yo-a-quarters, .yo-a-goals { align-self: start; }
}

/* 12 мини-месяцев — ровной сеткой внутри карточки */
.yo-a-cal { padding: 12px; }
.yo .yo-months.year-grid-calendar { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
@media (min-width: 640px) { .yo .yo-months.year-grid-calendar { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
@media (min-width: 900px) and (max-width: 1279px) { .yo .yo-months.year-grid-calendar { grid-template-columns: repeat(4, minmax(0, 1fr)); } }
.yo .year-month-card { padding: 8px; border-radius: 12px; background: var(--mo-soft); border: 1px solid transparent; box-shadow: none; }
.yo .year-month-title { font-size: 13px; margin-bottom: 4px; }
.yo .year-month-grid { gap: 2px; }
.yo .year-month-day { font-size: 10.5px; min-height: 0; }
.yo .mo-legend { margin-top: 10px; }

/* по кварталам */
.yo-qs { display: grid; gap: 4px; }
.yo-q {
    display: grid;
    grid-template-columns: 92px minmax(0, 1fr) 92px;
    align-items: center;
    gap: 10px;
    padding: 6px 8px;
    border: 0;
    border-radius: 10px;
    background: none;
    color: var(--mo-text);
    font: inherit;
    text-align: left;
    cursor: pointer;
}
.yo-q:hover { background: var(--mo-soft); }
.yo-q.is-now { background: color-mix(in srgb, var(--mo-accent) 10%, transparent); }
.yo-q-name { font-weight: 700; font-size: 14px; }
.yo-q-name small { font-weight: 500; font-size: 11.5px; color: var(--mo-muted); margin-left: 4px; }
.yo-q-v { text-align: right; font-size: 12.5px; color: var(--mo-muted); font-variant-numeric: tabular-nums; }
.yo-q-v b { margin-left: 6px; color: var(--mo-text); }

/* по месяцам — столбики: выполнено (низ), не выполнено, впереди */
.yo-bars { display: grid; grid-template-columns: repeat(12, minmax(0, 1fr)); gap: 4px; align-items: end; }
.yo-bar { display: flex; flex-direction: column; align-items: center; gap: 3px; padding: 0; border: 0; background: none; color: var(--mo-muted); font: inherit; cursor: pointer; }
.yo-bar-col {
    display: flex;
    flex-direction: column-reverse;
    justify-content: flex-start;
    width: 100%;
    max-width: 26px;
    height: 96px;
    border-radius: 6px;
    background: var(--mo-soft);
    overflow: hidden;
}
.yo-bar-done { background: var(--mo-ok); }
.yo-bar-miss { background: color-mix(in srgb, var(--mo-bad) 70%, transparent); }
.yo-bar-ahead { background: color-mix(in srgb, var(--mo-accent) 35%, transparent); }
.yo-bar:hover .yo-bar-col { box-shadow: 0 0 0 1.5px var(--mo-accent); }
.yo-bar-pct { font-size: 10px; font-weight: 600; min-height: 12px; color: var(--mo-text); }
.yo-bar-m { font-size: 10.5px; }
.yo-bar.is-now .yo-bar-m { color: var(--mo-accent); font-weight: 700; }

/* итоги года */
.yo-sum-meta { display: flex; flex-wrap: wrap; gap: 6px 14px; font-size: 12.5px; color: var(--mo-muted); margin-bottom: 6px; }
.yo-picked-preview { margin: 0 0 6px; padding: 0; list-style: none; display: grid; gap: 3px; font-size: 13.5px; }
.yo-picked-preview li { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* шторка «Итоги года» */
.yo-drawer { width: min(560px, 100vw); }
.yo-drawer-body { flex: 1; overflow-y: auto; padding: 12px 16px; display: grid; gap: 16px; align-content: start; }
.yo-drawer-foot { padding: 10px 16px calc(12px + env(safe-area-inset-bottom, 0px)); border-top: 1px solid var(--mo-line); display: flex; justify-content: flex-end; }
.yo-drawer-foot .btn { min-height: 38px; padding: 8px 20px; }
.yo-sec { display: grid; gap: 6px; }
.yo-sec-title { font-size: 14px; font-weight: 700; }
.yo-sec-title small { font-weight: 500; color: var(--mo-muted); margin-left: 4px; }
.yo-hint { font-size: 12px; color: var(--mo-muted); }
.yo-sec textarea { width: 100%; min-height: 120px; margin: 0; padding: 10px 12px; border-radius: 12px; border: 1px solid var(--mo-line); background: var(--mo-soft); color: var(--mo-text); font: inherit; font-size: 14.5px; line-height: 1.45; resize: vertical; }
.yo-filter { display: flex; flex-wrap: wrap; gap: 4px; }
.yo-filter button { height: 28px; padding: 0 10px; border-radius: 999px; border: 1px solid var(--mo-line); background: var(--mo-card); color: var(--mo-muted); font: inherit; font-size: 12.5px; font-weight: 600; cursor: pointer; }
.yo-filter button.is-active { background: var(--mo-accent); border-color: var(--mo-accent); color: #fff; }
.yo-moments { display: grid; gap: 2px; max-height: 46vh; overflow-y: auto; padding-right: 2px; }
.yo-mhead { margin: 8px 0 2px; font-size: 11px; font-weight: 700; letter-spacing: 0.05em; text-transform: uppercase; color: var(--mo-muted); }
.yo-moment { display: grid; grid-template-columns: 28px minmax(0, 1fr) auto; align-items: start; gap: 6px; padding: 4px 4px; border-radius: 8px; }
.yo-moment.is-on { background: color-mix(in srgb, #f5b301 12%, transparent); }
.yo-star { width: 26px; height: 26px; padding: 0; border: 0; border-radius: 50%; background: none; color: var(--mo-muted); font-size: 17px; line-height: 1; cursor: pointer; }
.yo-moment.is-on .yo-star { color: #f5b301; }
.yo-star:hover { background: var(--mo-soft); }
.yo-mtext { font-size: 13.5px; line-height: 1.4; padding-top: 3px; display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
.yo-mtext small { color: var(--mo-muted); }
.yo-mdate { font-size: 11.5px; color: var(--mo-muted); padding-top: 4px; white-space: nowrap; }
.yo-qnotes { padding: 8px 10px; border-radius: 12px; background: var(--mo-soft); }
.yo-qnotes-head { font-size: 13px; font-weight: 700; margin-bottom: 4px; }
.yo-qnotes-head small { font-weight: 500; color: var(--mo-muted); margin-left: 4px; }
.yo-mnote + .yo-mnote { margin-top: 6px; }
.yo-mnote-m { padding: 0; border: 0; background: none; color: var(--mo-accent); font: inherit; font-size: 12.5px; font-weight: 600; cursor: pointer; }
.yo-mnote p { margin: 2px 0 0; font-size: 13px; line-height: 1.45; white-space: pre-line; }

/* ---------- год на компьютере — без прокрутки ----------
   ≥1600: календарь | цифры, кварталы, месяцы | цели, итоги. Высота клетки мини-месяца —
   от высоты окна: 3 ряда месяцев × (заголовок + дни недели + 6 недель) ≈ 24 строки */
@media (min-width: 1280px) {
    .yo { --yo-cell: clamp(14px, calc((100vh - 340px) / 24), 40px); }
    .yo .yo-months.year-grid-calendar { grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 8px; }
    .yo .year-month-card { padding: 6px 8px; }
    .yo .year-month-title { padding: 0 0 2px; font-size: 13px; margin: 0; }
    .yo .year-month-grid { grid-auto-rows: var(--yo-cell); gap: 2px; }
    .yo .year-month-dow { padding: 0; font-size: 9px; line-height: var(--yo-cell); }
    .yo .year-month-day { aspect-ratio: auto; height: var(--yo-cell); font-size: clamp(9.5px, calc(var(--yo-cell) * 0.4), 12px); border-radius: 5px; }
    .yo .mo-legend { margin-top: 6px; font-size: 11px; }
    .yo .yo-a-cal { padding: 10px; }
    /* сводка плотнее */
    .yo .mo-card { padding: 10px 12px; }
    .yo .mo-card h3 { margin-bottom: 6px; }
    .yo .mo-kpi { padding: 6px 8px; }
    .yo .mo-kpi b { font-size: 17px; }
    .yo .yo-q { padding: 4px 8px; }
    .yo .yo-bar-col { height: clamp(48px, calc((100vh - 600px) / 3), 96px); }
    /* цели — по одной строке подписи */
    .yo .mo-goals { grid-template-columns: minmax(0, 1fr); gap: 7px; }
    .yo .mo-goal { gap: 2px; }
    .yo .mo-goal-sub { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
}
@media (min-width: 1280px) and (max-width: 1399px) {
    .yo-body {
        grid-template-columns: minmax(0, 1.25fr) minmax(320px, 1fr);
        grid-template-areas: "cal stats" "cal quarters" "cal months" "goals summary";
        grid-template-rows: auto auto 1fr auto;
    }
    .yo-a-months { align-self: stretch; }
}
@media (min-width: 1400px) {
    .yo-body {
        grid-template-columns: minmax(0, 1.5fr) minmax(280px, 1fr) minmax(280px, 1fr);
        grid-template-areas: "cal stats goals" "cal quarters goals" "cal months summary";
        grid-template-rows: auto auto 1fr;
    }
    .yo-a-goals { align-self: stretch; }
    .yo-a-summary, .yo-a-months { align-self: stretch; }
    .yo .mo-kpis { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}
