/* Golos Text — кириллический гротеск, лежит локально: вебвью не ходит во внешние сети за шрифтом. */
@font-face {
	font-family: "Golos Text";
	font-weight: 400 900;
	font-display: swap;
	src: url("fonts/golos-cyrillic.woff2") format("woff2");
	unicode-range: U+0301, U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116;
}
@font-face {
	font-family: "Golos Text";
	font-weight: 400 900;
	font-display: swap;
	src: url("fonts/golos-latin.woff2") format("woff2");
	unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215;
}

/* Один светлый стиль: белый лист, тонкие линии, прямые углы. Цвет появляется только там,
   где несёт смысл: зелёный — сон, янтарь — до обеда, красный — не придём, васильковый — действие. */
:root {
	color-scheme: light;
	--bg: #ffffff;
	--tint: #f5f7fb;
	--ink: #1a2233;
	--muted: #7a8398;
	--line: #e4e8f0;
	--line-strong: #c9d0de;
	--accent: #2f5bea;
	--accent-tint: #eef2fe;
	--sleep: #189a66;
	--sleep-tint: #e9f7f0;
	--early: #b87400;
	--early-fill: #f2ad33;
	--early-tint: #fef5e3;
	--absent: #d5423a;
	--absent-tint: #fdeeed;
}

* { box-sizing: border-box; border-radius: 0; -webkit-tap-highlight-color: transparent; }
[hidden] { display: none !important; }

html, body {
	margin: 0;
	background: var(--bg);
	color: var(--ink);
	font: 400 15px/1.4 "Golos Text", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
	font-variant-numeric: tabular-nums;
	-webkit-text-size-adjust: 100%;
	-webkit-font-smoothing: antialiased;
}

button, input, textarea { font: inherit; color: inherit; -webkit-appearance: none; appearance: none; }
button { cursor: pointer; border: 0; background: none; padding: 0; }
button:focus-visible, input:focus-visible, textarea:focus-visible, summary:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

#app {
	max-width: 520px;
	margin: 0 auto;
	padding: 14px 20px calc(28px + env(safe-area-inset-bottom));
	min-height: 100vh;
	display: flex;
	flex-direction: column;
	gap: 18px;
}

.center { display: flex; min-height: 60vh; align-items: center; justify-content: center; text-align: center; padding: 24px; }
.muted { color: var(--muted); }
.small { font-size: 13px; }

.ico { display: inline-flex; width: 20px; height: 20px; flex: none; }
.ico svg { width: 100%; height: 100%; fill: none; stroke: currentColor; stroke-width: 1.6; stroke-linecap: square; stroke-linejoin: miter; }

/* Шапка */
.top { display: flex; align-items: center; gap: 10px; }
.top-t { flex: 1; min-width: 0; }
.eyebrow { font-size: 11.5px; font-weight: 500; letter-spacing: .09em; text-transform: uppercase; color: var(--muted); }
.top h1 { margin: 2px 0 0; font-size: 22px; line-height: 1.2; font-weight: 600; letter-spacing: -.015em; text-wrap: balance; }
.icon-btn { display: inline-flex; align-items: center; justify-content: center; width: 42px; height: 42px; flex: none; border: 1px solid var(--line-strong); background: var(--bg); color: var(--ink); }
.icon-btn:active { background: var(--tint); }
.dev-badge { font-size: 10px; font-weight: 600; letter-spacing: .08em; color: var(--early); border: 1px solid currentColor; padding: 2px 6px; }

/* Подсказка о сроке: сворачивается, выбор запоминается */
.hint { background: var(--tint); }
.hint summary { display: flex; align-items: center; gap: 10px; padding: 12px 14px; font-size: 14.5px; cursor: pointer; list-style: none; user-select: none; }
.hint summary::-webkit-details-marker { display: none; }
.hint summary span:first-child { flex: 1; }
.hint summary .ico { width: 18px; height: 18px; color: var(--muted); transition: transform .15s; }
.hint[open] summary .ico { transform: rotate(180deg); }
.hint b { font-weight: 600; }
.hint p { margin: 0; padding: 0 14px 14px; font-size: 13.5px; color: var(--muted); line-height: 1.45; }
.hint p b { color: var(--ink); }

/* Три числа дня: записано · пришло · на сон */
.today-b { display: flex; flex-direction: column; gap: 12px; }
.today-b .week-h { margin-bottom: -12px; }
.stats { display: grid; grid-template-columns: repeat(3, 1fr); border-bottom: 1px solid var(--line); }
.stat { padding: 12px 0 12px 14px; border-left: 1px solid var(--line); }
.stat:first-child { padding-left: 0; border-left: 0; }
.stat-n { font-size: 30px; font-weight: 400; line-height: 1; letter-spacing: -.03em; }
.stat-n small { font-size: 15px; color: var(--muted); letter-spacing: 0; }
.stat-l { margin-top: 5px; font-size: 12px; color: var(--muted); line-height: 1.25; }
.stat.over .stat-n, .stat.over .stat-l { color: var(--absent); }
.sum-warn { font-size: 13px; color: var(--absent); line-height: 1.35; }

/* Меню ☰ */
.viewsw { margin-bottom: 14px; }
.item.nav { gap: 14px; padding: 12px 0; }
.item.nav > .ico:first-child { color: var(--accent); width: 22px; height: 22px; }
.item.nav > .ico:last-child { color: var(--line-strong); width: 16px; height: 16px; }

/* Список воспитателя: состояние ребёнка и две кнопки */
.chip small { font-size: 12px; color: var(--muted); }
.tlist { border-top: 1px solid var(--ink); margin-top: -18px; }
.trow { display: flex; flex-direction: column; gap: 8px; padding: 12px 0; border-bottom: 1px solid var(--line); }
.tline { display: flex; align-items: center; gap: 10px; min-width: 0; }
.tname { flex: 1; min-width: 0; font-size: 15px; font-weight: 500; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.trow.absent .tname { color: var(--absent); text-decoration: line-through; text-decoration-thickness: 1px; }
.trow.early .tname { color: var(--early); }
.trow.planned .tname { color: var(--muted); }
.trow.planned .ttog button.on-absent { background: var(--bg); color: var(--absent); }
.ttog { display: flex; gap: 6px; flex: none; }
.ttog button { min-height: 34px; padding: 0 12px; border: 1px solid var(--line-strong); background: var(--bg); font-size: 13.5px; font-weight: 500; white-space: nowrap; }
.ttog button:active { background: var(--tint); }
.ttog button.on-absent { background: var(--absent); border-color: var(--absent); color: #fff; }
.ttog button.on-early { background: var(--early-fill); border-color: var(--early-fill); color: #2a1b00; }
.twho { flex: 1; min-width: 0; text-align: right; font-size: 12px; color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* Табель: таблица шире экрана прокручивается внутри своего контейнера */
.sheet-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; }
.tsheet { border-collapse: collapse; font-size: 12.5px; border-top: 1px solid var(--ink); }
.tsheet th, .tsheet td { height: 30px; min-width: 26px; padding: 0 2px; text-align: center; border-bottom: 1px solid var(--line); font-weight: 400; white-space: nowrap; }
.tsheet thead th { height: 40px; color: var(--muted); font-size: 12px; vertical-align: bottom; padding-bottom: 5px; border-bottom-color: var(--line-strong); }
.tsheet thead th span { display: block; font-size: 9.5px; letter-spacing: .06em; text-transform: uppercase; }
.tsheet .tn { position: sticky; left: 0; z-index: 1; min-width: 128px; max-width: 128px; padding-right: 8px; text-align: left; background: var(--bg); color: var(--ink); overflow: hidden; text-overflow: ellipsis; border-right: 1px solid var(--line-strong); }
.tsheet .tt { min-width: 40px; font-weight: 600; color: var(--ink); border-left: 1px solid var(--line-strong); }
.tsheet .now { background: var(--accent-tint); }
.tsheet thead .now { color: var(--accent); font-weight: 600; }
.tsheet td.ok { color: var(--line-strong); }
.tsheet td.a { color: var(--absent); background: var(--absent-tint); font-weight: 600; }
.tsheet td.e { color: var(--early); background: var(--early-tint); font-weight: 600; }
.tsheet td.na { background: repeating-linear-gradient(135deg, transparent 0 3px, var(--line) 3px 4px); }
.tsheet td.plan { color: var(--muted); }
.tsheet tr.tf td, .tsheet tr.tf th { border-bottom: 0; border-top: 1px solid var(--ink); font-weight: 500; color: var(--ink); }
.legend { display: flex; flex-wrap: wrap; gap: 6px 16px; font-size: 12.5px; color: var(--muted); margin-top: -6px; }
.legend span { display: inline-flex; align-items: center; gap: 6px; }
.legend i { display: inline-flex; align-items: center; justify-content: center; width: 20px; height: 20px; font-style: normal; font-size: 12px; font-weight: 600; border: 1px solid var(--line); }
.legend i.ok { color: var(--line-strong); }
.legend i.a { color: var(--absent); background: var(--absent-tint); border-color: transparent; }
.legend i.e { color: var(--early); background: var(--early-tint); border-color: transparent; }
.legend i.plan { color: var(--muted); background: none; border-color: var(--line); font-weight: 400; }

/* Дети */
.chips { display: flex; gap: 0; overflow-x: auto; margin: 0 -20px; padding: 0 20px; scrollbar-width: none; border-bottom: 1px solid var(--line); }
.chips::-webkit-scrollbar { display: none; }
.chip { flex: none; min-height: 40px; padding: 0 14px; font-size: 14px; color: var(--muted); white-space: nowrap; border-bottom: 2px solid transparent; margin-bottom: -1px; }
.chip.active { color: var(--ink); font-weight: 600; border-bottom-color: var(--accent); }

/* Неделя: заголовок с линией, дни — строки через волосяные разделители */
.week-h { display: flex; align-items: baseline; justify-content: space-between; padding-bottom: 8px; border-bottom: 1px solid var(--ink); font-size: 11.5px; font-weight: 600; letter-spacing: .09em; text-transform: uppercase; }
.week-h span:last-child { letter-spacing: 0; text-transform: none; font-weight: 400; font-size: 13px; color: var(--muted); }
.week { margin-top: -18px; }

.drow { display: flex; gap: 14px; padding: 14px 0; border-bottom: 1px solid var(--line); }

/* «Листок календаря» окрашивается по состоянию дня — колонка листков читается как рисунок недели. */
.leaf { flex: none; width: 48px; align-self: stretch; min-height: 66px; border: 1px solid var(--line-strong); display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px; }
.leaf-wd { font-size: 11px; font-weight: 500; letter-spacing: .09em; text-transform: uppercase; color: var(--muted); }
.leaf-n { font-size: 22px; font-weight: 500; line-height: 1; }
.drow.early .leaf { border-color: var(--early-fill); background: var(--early-tint); }
.drow.early .leaf-n, .drow.early .leaf-wd { color: var(--early); }
.drow.absent .leaf { border-color: var(--absent); background: var(--absent-tint); }
.drow.absent .leaf-n, .drow.absent .leaf-wd { color: var(--absent); }
.drow.today .leaf { border: 2px solid var(--ink); }
.drow.today.early .leaf { border-color: var(--early); }
.drow.today.absent .leaf { border-color: var(--absent); }

.dmain { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 9px; }
.dline { display: flex; align-items: center; gap: 7px; min-height: 22px; }
.dstatus { flex: 1; min-width: 0; font-size: 15px; font-weight: 500; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.dstatus small { font-size: 13px; font-weight: 400; color: var(--muted); }
.drow.early .dstatus { color: var(--early); }
.drow.absent .dstatus { color: var(--absent); }
.dlock { display: inline-flex; color: var(--muted); }
.dlock .ico { width: 15px; height: 15px; }
.dnote { font-size: 12.5px; color: var(--muted); line-height: 1.35; }

.pill { flex: none; font-size: 12.5px; font-weight: 500; color: var(--muted); white-space: nowrap; }
.pill.full { color: var(--early); padding: 2px 7px; background: var(--early-tint); }
.pill.over { color: var(--absent); padding: 2px 7px; background: var(--absent-tint); }

.toggles { display: grid; grid-template-columns: 1fr 1.25fr; gap: 8px; }
.toggles button { min-height: 38px; padding: 0 8px; border: 1px solid var(--line-strong); background: var(--bg); font-size: 14px; font-weight: 500; transition: background-color .12s, border-color .12s, color .12s; }
.toggles button:active { background: var(--tint); }
.toggles button:disabled { opacity: .4; cursor: default; }
.toggles button.on-absent { background: var(--absent); border-color: var(--absent); color: #fff; }
.toggles button.on-early { background: var(--early-fill); border-color: var(--early-fill); color: #2a1b00; }

/* Кнопки и формы */
.btn { display: flex; align-items: center; justify-content: center; gap: 8px; width: 100%; min-height: 48px; border: 1px solid var(--accent); background: var(--accent); color: #fff; font-size: 15.5px; font-weight: 500; }
.btn:active { opacity: .88; }
.btn:disabled { opacity: .4; }
.btn.ghost { background: var(--bg); color: var(--accent); }
.btn.danger { background: var(--bg); border-color: var(--absent); color: var(--absent); }
.btn + .btn { margin-top: 8px; }
.form-gap { height: 18px; }

.onb { padding-top: 2vh; }
.onb p { margin: 0 0 8px; color: var(--muted); font-size: 15px; max-width: 34em; }
label.field { display: block; font-size: 11.5px; font-weight: 500; letter-spacing: .09em; text-transform: uppercase; color: var(--muted); margin: 18px 0 7px; }
.input { width: 100%; min-height: 48px; padding: 11px 14px; border: 1px solid var(--line-strong); background: var(--bg); font-size: 16px; outline: none; }
.input:focus { border-color: var(--accent); box-shadow: inset 0 0 0 1px var(--accent); }
.input::placeholder { color: #aab1c2; }
textarea.input { min-height: 132px; resize: vertical; line-height: 1.45; }
.suggest { margin-top: -1px; border: 1px solid var(--line-strong); background: var(--bg); }
.suggest button { display: flex; width: 100%; padding: 12px 14px; text-align: left; border-top: 1px solid var(--line); gap: 8px; }
.suggest button:first-child { border-top: 0; }
.suggest button:active { background: var(--tint); }
.suggest .g { color: var(--muted); margin-left: auto; font-size: 13px; }
.pick { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.pick button { min-height: 46px; padding: 0 6px; border: 1px solid var(--line-strong); background: var(--bg); font-size: 14.5px; font-weight: 500; line-height: 1.15; }
.pick button.active { border-color: var(--accent); background: var(--accent); color: #fff; }
.pick.three { grid-template-columns: repeat(3, 1fr); }
.check { display: flex; align-items: center; gap: 10px; margin-top: 16px; font-size: 15px; }
.check input { -webkit-appearance: auto; appearance: auto; width: 20px; height: 20px; accent-color: var(--accent); }

.seg { display: grid; gap: 8px; }
.seg button { min-height: 50px; border: 1px solid var(--line-strong); background: var(--bg); font-size: 15px; font-weight: 500; }
.seg button.on-sleep { background: var(--sleep); border-color: var(--sleep); color: #fff; }
.seg button.on-early { background: var(--early-fill); border-color: var(--early-fill); color: #2a1b00; }
.seg button.on-absent { background: var(--absent); border-color: var(--absent); color: #fff; }

.stepper { display: flex; align-items: center; gap: 8px; }
.stepper .icon-btn { width: 54px; height: 50px; font-size: 22px; font-weight: 400; }
.stepper-value { flex: 1; text-align: center; font-size: 28px; font-weight: 500; border: 1px solid var(--line-strong); line-height: 48px; }

/* Воспитатель */
.datenav { display: flex; align-items: center; gap: 8px; }
.datenav .mid { flex: 1; text-align: center; line-height: 1.25; }
.datenav .mid b { display: block; font-size: 18px; font-weight: 600; letter-spacing: -.01em; }

/* Сетка кроваток: одна клетка — одно спальное место, лишние дети — красные сверх сетки. */
.beds { display: grid; grid-template-columns: repeat(auto-fill, minmax(12px, 1fr)); gap: 3px; }
.beds i { display: block; height: 10px; border: 1px solid var(--line-strong); }
.beds i.busy { background: var(--sleep); border-color: var(--sleep); }
.beds i.over { background: var(--absent); border-color: var(--absent); }
.sum-warn { font-size: 13px; color: var(--absent); line-height: 1.35; }

.search { position: relative; }
.search .ico { position: absolute; left: 13px; top: 50%; transform: translateY(-50%); color: var(--muted); width: 18px; height: 18px; pointer-events: none; }
.search .input { min-height: 42px; padding: 8px 14px 8px 40px; font-size: 15px; }
.search .input::-webkit-search-cancel-button { -webkit-appearance: auto; appearance: auto; }

.list { border-top: 1px solid var(--line); }
.sec .list { border-top: 0; }
.item { display: flex; width: 100%; align-items: center; gap: 10px; padding: 10px 0; text-align: left; border-bottom: 1px solid var(--line); min-height: 46px; }
button.item:active { background: var(--tint); }
.item .name { flex: 1; min-width: 0; font-size: 15px; }
.item .by { font-size: 12px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.badge { flex: none; min-width: 24px; text-align: center; font-size: 12px; font-weight: 500; padding: 2px 6px; border: 1px solid var(--line-strong); color: var(--muted); }
.mark-dot { flex: none; display: inline-block; width: 9px; height: 9px; background: var(--line-strong); }
.mark-dot.sleep { background: var(--sleep); }
.mark-dot.early { background: var(--early-fill); }
.mark-dot.absent { background: var(--absent); }
.del { color: var(--absent); font-size: 13.5px; font-weight: 500; padding: 8px 0 8px 8px; }
.empty { text-align: center; color: var(--muted); padding: 28px 16px; font-size: 14px; }

/* Шторка */
.backdrop { position: fixed; inset: 0; background: rgba(26, 34, 51, .38); z-index: 20; display: flex; align-items: flex-end; justify-content: center; }
.sheet { width: 100%; max-width: 520px; max-height: 88vh; overflow-y: auto; background: var(--bg); border-top: 2px solid var(--ink); padding: 20px 20px calc(24px + env(safe-area-inset-bottom)); animation: up .16s ease-out; }
.sheet h3 { margin: 0 0 4px; font-size: 20px; font-weight: 600; letter-spacing: -.015em; text-wrap: balance; }
.sheet .sub { color: var(--muted); font-size: 14px; margin-bottom: 16px; }
@keyframes up { from { transform: translateY(20px); opacity: 0; } to { transform: none; opacity: 1; } }

#toast { position: fixed; left: 50%; bottom: calc(96px + env(safe-area-inset-bottom)); transform: translateX(-50%); z-index: 30; width: max-content; max-width: calc(100% - 40px); padding: 11px 16px; background: var(--ink); color: #fff; font-size: 14px; text-align: center; opacity: 0; pointer-events: none; transition: opacity .2s; }
#toast.show { opacity: 1; }

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