:root {
	--blue: #0a7cff;
	--blue-2: #5aa9ff;
	--blue-soft: rgba(10, 124, 255, .12);
	--ink: #0b1b33;
	--ink-2: #4a5a74;
	--ink-3: #8a97ad;
	--line: rgba(11, 27, 51, .08);
	--glass: rgba(255, 255, 255, .58);
	--glass-strong: rgba(255, 255, 255, .78);
	--glass-border: rgba(255, 255, 255, .85);
	--shadow: 0 10px 30px rgba(20, 60, 140, .10), 0 1px 2px rgba(20, 60, 140, .06);
	--red: #ff3b30;
	--green: #22b35e;
	--radius: 22px;
	--font: -apple-system, BlinkMacSystemFont, "SF Pro Text", Onest, "Segoe UI", Roboto, sans-serif;
	--safe-b: env(safe-area-inset-bottom, 0px);
	--safe-t: env(safe-area-inset-top, 0px);
}

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
/* Как у приложения: без зума двойным тапом, без растягивания страницы за края. */
html, body { margin: 0; touch-action: pan-y; overscroll-behavior: none; -webkit-text-size-adjust: 100%; }
button, a, nav, .cal-day { -webkit-touch-callout: none; -webkit-user-select: none; user-select: none; }
/* iOS увеличивает страницу при фокусе на поле со шрифтом меньше 16px — держим 16+. */
input, textarea { font-size: max(16px, 1em); }

/* Сдвиг экрана при свайпе. */
#app.slide-l { animation: slide-l .22s ease-out; }
#app.slide-r { animation: slide-r .22s ease-out; }
@keyframes slide-l { from { transform: translateX(40px); opacity: .4; } }
@keyframes slide-r { from { transform: translateX(-40px); opacity: .4; } }
body {
	font-family: var(--font);
	color: var(--ink);
	background: #eef4ff;
	min-height: 100vh;
	-webkit-font-smoothing: antialiased;
}

/* Мягкие синие пятна под стеклом. */
.bg { position: fixed; inset: 0; z-index: -1; overflow: hidden; background: linear-gradient(180deg, #f5f9ff 0%, #e8f0ff 100%); }
.bg i { position: absolute; border-radius: 50%; filter: blur(60px); opacity: .55; }
.bg i:nth-child(1) { width: 380px; height: 380px; background: #7db8ff; top: -120px; right: -120px; }
.bg i:nth-child(2) { width: 320px; height: 320px; background: #b9d7ff; bottom: 10%; left: -140px; }
.bg i:nth-child(3) { width: 260px; height: 260px; background: #9ec5ff; bottom: -80px; right: -60px; opacity: .4; }

.glass {
	background: var(--glass);
	backdrop-filter: blur(24px) saturate(180%);
	-webkit-backdrop-filter: blur(24px) saturate(180%);
	border: 1px solid var(--glass-border);
	box-shadow: var(--shadow);
}

#app {
	max-width: 620px;
	margin: 0 auto;
	padding: calc(var(--safe-t) + 18px) 16px calc(var(--safe-b) + 110px);
}

h1 { font-size: 34px; font-weight: 800; letter-spacing: -.02em; margin: 8px 4px 16px; }
h2 { font-size: 13px; font-weight: 600; text-transform: uppercase; letter-spacing: .06em; color: var(--ink-3); margin: 26px 8px 8px; }

.card { border-radius: var(--radius); padding: 6px; margin-bottom: 12px; }
.card.pad { padding: 16px; }

button, input, textarea { font: inherit; color: inherit; }
button { cursor: pointer; border: 0; background: none; }

/* Поле ввода со стеклянной подложкой и синей кнопкой. */
.compose { display: flex; gap: 8px; align-items: flex-end; border-radius: var(--radius); padding: 6px; margin-bottom: 14px; }
.compose textarea, .compose input {
	flex: 1; min-width: 0; border: 0; outline: 0; background: transparent;
	padding: 11px 12px; font-size: 17px; resize: none; line-height: 1.35; max-height: 180px;
}
.compose textarea::placeholder, .compose input::placeholder { color: var(--ink-3); }

.btn {
	display: inline-flex; align-items: center; justify-content: center; gap: 6px;
	height: 44px; padding: 0 18px; border-radius: 16px;
	font-size: 16px; font-weight: 600; transition: transform .12s, opacity .12s;
}
.btn:active { transform: scale(.96); }
.btn:disabled { opacity: .4; }
.btn-blue { color: #fff; background: linear-gradient(180deg, var(--blue-2), var(--blue)); box-shadow: 0 6px 16px rgba(10, 124, 255, .35); }
.btn-round { width: 44px; padding: 0; border-radius: 50%; font-size: 24px; font-weight: 500; }
.btn-glass { color: var(--blue); background: var(--glass-strong); border: 1px solid var(--glass-border); backdrop-filter: blur(20px); -webkit-backdrop-filter: blur(20px); }
.btn-wide { width: 100%; }
.btn-danger { color: var(--red); }

/* Список задач. */
.list { list-style: none; margin: 0; padding: 0; }
.row {
	display: flex; align-items: center; gap: 12px; padding: 13px 12px; border-radius: 16px;
	text-decoration: none; color: inherit; transition: background .15s;
}
.row:active { background: var(--blue-soft); }
.list li + li .row { border-top: 1px solid var(--line); border-radius: 0 0 16px 16px; }
.row-main { flex: 1; min-width: 0; }
.row-title { font-size: 17px; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.row-meta { font-size: 13px; color: var(--ink-3); margin-top: 3px; display: flex; gap: 10px; }
.row-chev { color: var(--ink-3); font-size: 22px; line-height: 1; }
.row.done .row-title { color: var(--ink-3); text-decoration: line-through; }
.pill { font-size: 12px; font-weight: 600; color: var(--blue); background: var(--blue-soft); border-radius: 999px; padding: 2px 8px; }

.empty { text-align: center; color: var(--ink-3); padding: 28px 16px; font-size: 15px; }
.toggle { display: block; width: 100%; text-align: left; color: var(--blue); font-weight: 600; font-size: 15px; padding: 14px 8px; }

/* Экран задачи. */
.back { display: inline-flex; align-items: center; gap: 2px; color: var(--blue); font-size: 17px; text-decoration: none; padding: 6px 4px; }
.back::before { content: "‹"; font-size: 30px; line-height: 0; margin-top: -3px; }
.title-input {
	width: 100%; border: 0; outline: 0; background: transparent; resize: none; overflow: hidden;
	font-size: 30px; font-weight: 800; letter-spacing: -.02em; line-height: 1.15; padding: 8px 4px 4px;
}
.desc {
	width: 100%; border: 0; outline: 0; background: transparent; resize: none; overflow: hidden;
	font-size: 16px; line-height: 1.45; min-height: 46px; padding: 4px;
}
.desc::placeholder { color: var(--ink-3); }
.saved { font-size: 12px; color: var(--green); margin-left: 8px; opacity: 0; transition: opacity .3s; }
.saved.on { opacity: 1; }

.sub { display: flex; align-items: center; gap: 12px; padding: 11px 10px; }
.sub + .sub { border-top: 1px solid var(--line); }
.sub a { flex: 1; color: inherit; text-decoration: none; font-size: 16px; }
.sub.done a { color: var(--ink-3); text-decoration: line-through; }
.check {
	flex: none; width: 26px; height: 26px; border-radius: 50%; border: 2px solid #c3cfe0;
	display: grid; place-items: center; transition: all .15s;
}
.check.on { background: var(--blue); border-color: var(--blue); }
.check.on::after { content: ""; width: 10px; height: 6px; border: 2.5px solid #fff; border-top: 0; border-right: 0; transform: rotate(-45deg) translate(1px, -1px); }
.sub-add { display: flex; gap: 8px; padding: 6px 4px 4px; }
.sub-add input { flex: 1; border: 0; outline: 0; background: transparent; font-size: 16px; padding: 8px 6px; }

/* Журнал «что сделал». */
.day { font-size: 13px; font-weight: 700; color: var(--ink-2); margin: 16px 8px 6px; }
.entry { display: flex; gap: 12px; padding: 12px 12px; }
.entry + .entry { border-top: 1px solid var(--line); }
.entry time { flex: none; width: 44px; font-size: 13px; font-weight: 600; color: var(--blue); padding-top: 2px; font-variant-numeric: tabular-nums; }
.entry-text { flex: 1; font-size: 16px; line-height: 1.4; white-space: pre-wrap; word-break: break-word; }
.entry-sub { font-size: 12px; color: var(--ink-3); margin-bottom: 2px; }
.entry-del { color: var(--ink-3); font-size: 18px; padding: 0 4px; align-self: flex-start; }

.actions { display: grid; gap: 10px; margin-top: 26px; }

/* Календарь. */
.cal-head { display: flex; align-items: center; justify-content: space-between; padding: 8px 6px 12px; }
.cal-head strong { font-size: 19px; font-weight: 700; text-transform: capitalize; }
.cal-grid { display: grid; grid-template-columns: repeat(7, 1fr); gap: 4px; padding: 0 6px 10px; }
.cal-wd { text-align: center; font-size: 12px; font-weight: 600; color: var(--ink-3); padding: 4px 0; }
.cal-day {
	height: 46px; border-radius: 14px; display: flex; flex-direction: column; align-items: center; justify-content: center;
	font-size: 16px; font-weight: 500; position: relative; font-variant-numeric: tabular-nums;
}
.cal-day.out { color: #c3cfe0; }
.cal-day.today { color: var(--blue); font-weight: 800; }
.cal-day.has::after { content: ""; position: absolute; bottom: 7px; width: 5px; height: 5px; border-radius: 50%; background: var(--blue); }
.cal-day.sel { background: linear-gradient(180deg, var(--blue-2), var(--blue)); color: #fff; box-shadow: 0 6px 14px rgba(10, 124, 255, .3); }
.cal-day.sel::after { background: #fff; }
.task-link { display: block; color: var(--ink); text-decoration: none; font-weight: 700; font-size: 15px; padding: 12px 12px 2px; }

/* Вкладки снизу — плавающая стеклянная плашка. */
#tabs {
	position: fixed; left: 50%; transform: translateX(-50%);
	bottom: calc(var(--safe-b) + 14px);
	display: flex; gap: 4px; padding: 5px; border-radius: 999px; z-index: 10;
}
#tabs a {
	display: flex; flex-direction: column; align-items: center; gap: 2px;
	min-width: 104px; padding: 7px 14px; border-radius: 999px;
	color: var(--ink-2); text-decoration: none; font-size: 11px; font-weight: 600;
}
#tabs svg { width: 24px; height: 24px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; }
#tabs svg circle { fill: currentColor; stroke: none; }
#tabs a.on { color: var(--blue); background: rgba(10, 124, 255, .12); }

/* Вход. */
.login { margin-top: 12vh; }
.login .field { display: block; width: 100%; border: 0; outline: 0; background: transparent; font-size: 17px; padding: 14px 12px; }
.login .field + .field { border-top: 1px solid var(--line); }
.err { color: var(--red); font-size: 14px; padding: 10px 8px 0; min-height: 20px; }
.foot { text-align: center; margin-top: 28px; font-size: 14px; display: flex; gap: 18px; justify-content: center; }
.foot a, .foot button { color: var(--ink-3); text-decoration: none; font-size: 14px; }

.toast {
	position: fixed; left: 50%; top: calc(var(--safe-t) + 14px); transform: translateX(-50%);
	padding: 10px 16px; border-radius: 14px; font-size: 14px; font-weight: 600; z-index: 20;
}
