/* Шаг — бумага, чёрная линия и жёлтый. Заголовки Unbounded, текст Onest. Плавность — zhivoy.css. */
@font-face { font-family: 'Onest'; font-style: normal; font-weight: 400 700; font-display: swap; src: url(/fonts/onest-cyr.woff2) format('woff2'); unicode-range: U+0301, U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116; }
@font-face { font-family: 'Onest'; font-style: normal; font-weight: 400 700; font-display: swap; src: url(/fonts/onest-lat.woff2) format('woff2'); unicode-range: U+0020-007E, U+00A0-00FF, U+2010-2015, U+2018-201E, U+2022, U+2026, U+2039-203A, U+20AC, U+2122, U+2212; }
@font-face { font-family: 'Unbounded'; font-style: normal; font-weight: 500 700; font-display: swap; src: url(/fonts/unbounded-cyr.woff2) format('woff2'); unicode-range: U+0301, U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116; }
@font-face { font-family: 'Unbounded'; font-style: normal; font-weight: 500 700; font-display: swap; src: url(/fonts/unbounded-lat.woff2) format('woff2'); unicode-range: U+0020-007E, U+00A0-00FF, U+2010-2015, U+2018-201E, U+2022, U+2026, U+2039-203A, U+20AC, U+2122, U+2212; }
/* Ритм — бумага и спокойный бирюзовый. Точное — закрашено целиком, неточное — контур со штриховкой (RITM-1). */
:root {
  --paper: #f2f0ea; --card: #fbfaf6; --ink: #18191b; --ink-2: #5d5e57; --line: #dcd8cc; --line-2: #e8e5db;
  --acc: #0f766e; --acc-l: #d5ebe7; --red: #b3391f; --red-l: #f6ddd5; --motiv: #8a9a8c;
  --head: 'Unbounded', 'Onest', sans-serif; --text: 'Onest', system-ui, sans-serif;
  --quick: 66px;
}
* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html { background: var(--paper); color-scheme: light; }
body { margin: 0; font-family: var(--text); color: var(--ink); background: var(--paper); min-height: 100dvh; }
body.lock { overflow: hidden; }
h1, h2, h3, p, ul, ol { margin: 0; }
ul, ol { padding: 0; list-style: none; }
a { color: inherit; }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; border: 0; background: none; padding: 0; text-align: inherit; }
[hidden] { display: none !important; }
.muted { color: var(--ink-2); }
.small { font-size: .8125rem; }
.center { text-align: center; margin-inline: auto; }

#app { max-width: 720px; margin: 0 auto; padding-bottom: calc(var(--quick) + env(safe-area-inset-bottom) + 30px); }
.pad { padding: 0 14px; display: flex; flex-direction: column; gap: 14px; }

/* Шапка — прилипает, под системной полосой ничего не просвечивает */
.top { position: sticky; top: 0; z-index: 4; background: var(--paper); padding: calc(env(safe-area-inset-top) + 10px) 14px 8px; display: flex; flex-direction: column; gap: 8px; }
.row1, .row2 { display: flex; align-items: center; gap: 8px; }
.ttl { font-family: var(--head); font-weight: 600; font-size: 1.3rem; letter-spacing: -.02em; flex: 1; min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ttl span { color: var(--ink-2); font-weight: 500; }
.ic { width: 42px; height: 42px; border-radius: 12px; display: grid; place-items: center; flex: none; }
.ic:hover { background: var(--line-2); }
.ic.sm { width: 38px; height: 38px; }
.seg { flex: 1; display: flex; background: var(--line-2); border-radius: 11px; padding: 3px; }
.seg button { flex: 1; text-align: center; padding: 7px 0; border-radius: 8px; font-size: .9375rem; color: var(--ink-2); }
.seg button.on { background: var(--card); color: var(--ink); font-weight: 600; box-shadow: 0 1px 2px rgba(0,0,0,.08); }
.chip { padding: 7px 12px; border-radius: 999px; border: 1.5px solid var(--line); background: var(--card); font-size: .875rem; white-space: nowrap; }
.chip.on { border-color: var(--ink); background: var(--ink); color: var(--paper); }
.chip.x { border-color: var(--acc); color: var(--acc); font-weight: 600; }
.chips { display: flex; flex-wrap: wrap; gap: 6px; }
.link { color: var(--acc); font-weight: 600; text-decoration: underline; text-underline-offset: 3px; }
.link.h { font-family: var(--head); font-size: 1.02rem; font-weight: 600; color: var(--ink); text-decoration: none; }
.banner { display: flex; justify-content: space-between; align-items: center; gap: 10px; margin: 0 14px 10px; padding: 11px 14px; border-radius: 12px; background: var(--ink); color: var(--paper); width: calc(100% - 28px); }
.banner span { text-decoration: underline; }

/* Знак: ● точное — закрашено, ◐ неточное — контур со штрихом */
.mk { display: inline-block; width: 9px; height: 9px; border-radius: 50%; flex: none; vertical-align: middle; }
.mk.x { background: var(--c, var(--acc)); }
.mk.o { border: 1.6px solid var(--c, var(--acc)); background: repeating-linear-gradient(135deg, color-mix(in srgb, var(--c, var(--acc)) 45%, transparent) 0 1.5px, transparent 1.5px 3.5px); }

/* Полоска загрузки дня: сплошная часть — точное, штрих — примерное и MoTiv */
.bar { display: flex; height: 5px; border-radius: 3px; background: var(--line-2); overflow: hidden; width: 100%; }
.bar i { background: var(--acc); }
.bar b { background: repeating-linear-gradient(135deg, color-mix(in srgb, var(--acc) 55%, transparent) 0 2px, transparent 2px 4px); }
.bar.over { box-shadow: 0 0 0 1.5px var(--red); }
.bar.over i { background: var(--red); }
.bar.over b { background: repeating-linear-gradient(135deg, color-mix(in srgb, var(--red) 55%, transparent) 0 2px, transparent 2px 4px); }
.bar.big { height: 9px; border-radius: 5px; }
.bar.empty { background: transparent; }

/* Месяц */
.wdh { display: grid; grid-template-columns: repeat(7, 1fr); text-align: center; font-size: .75rem; color: var(--ink-2); text-transform: uppercase; letter-spacing: .05em; }
.grid { display: grid; grid-template-columns: repeat(7, 1fr); gap: 3px; }
.cell { aspect-ratio: 1 / 1.08; min-height: 46px; border-radius: 10px; background: var(--card); padding: 5px 5px 6px; display: flex; flex-direction: column; align-items: center; gap: 3px; border: 1.5px solid transparent; overflow: hidden; }
.cell .num { font-size: .9375rem; line-height: 1.2; font-variant-numeric: tabular-nums; }
.cell .marks { flex: 1; display: flex; flex-wrap: wrap; justify-content: center; align-content: flex-start; gap: 2px; }
.cell .marks .mk { width: 7px; height: 7px; }
.cell .marks .mk.o { border-width: 1.3px; }
.cell .marks em { font-style: normal; font-size: .625rem; color: var(--ink-2); line-height: 7px; }
.cell .bar { height: 4px; }
.cell.l3 { background: color-mix(in srgb, var(--acc) 6%, var(--card)); }
.cell.l4 { background: color-mix(in srgb, var(--acc) 11%, var(--card)); }
.cell.other { background: transparent; }
.cell.other .num { color: #a9a698; }
.cell.past .num { color: var(--ink-2); }
.cell.today .num { background: var(--acc); color: #fff; border-radius: 999px; padding: 0 6px; font-weight: 700; }
.cell.sel { border-color: var(--ink); }

/* Повестка дня под месяцем */
.agenda { display: flex; flex-direction: column; gap: 8px; padding-top: 6px; }
.ag-h { display: flex; justify-content: space-between; align-items: baseline; gap: 8px; }
.ag-h .muted { font-size: .875rem; white-space: nowrap; }
.empty { color: var(--ink-2); padding: 18px 4px; }
.ev { display: flex; gap: 12px; align-items: stretch; width: 100%; padding: 10px 12px; border-radius: 12px; min-height: 52px; }
.ev .tm { width: 48px; flex: none; font-variant-numeric: tabular-nums; font-weight: 600; font-size: .9375rem; display: flex; flex-direction: column; line-height: 1.25; }
.ev .tm small { font-weight: 400; opacity: .8; font-size: .8125rem; }
.ev .tm .sym { font-size: 1.1rem; }
.ev .bd { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 1px; }
.ev .bd b { font-weight: 600; overflow-wrap: anywhere; }
.ev .bd small { font-size: .8125rem; opacity: .85; }
.ev.x { background: var(--c); color: #fff; }
.ev.o { border: 1.8px solid var(--c); color: var(--ink); background: repeating-linear-gradient(135deg, color-mix(in srgb, var(--c) 13%, var(--card)) 0 6px, var(--card) 6px 12px); }
.ev.o .tm { color: var(--c); }
.ev.m { border: 1.5px dashed var(--motiv); color: var(--ink-2); background: transparent; }
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 6px; padding: 12px 18px; border-radius: 12px; font-weight: 600; text-decoration: none; text-align: center; }
.btn.main { background: var(--ink); color: var(--paper); }
.btn.soft { background: var(--line-2); }
.btn.ghost { border: 1.5px solid var(--line); }
.btn.danger { color: var(--red); }
.btn.wide { width: 100%; }
.btn:disabled { opacity: .5; }

/* Неделя */
.week-sum { padding-top: 2px; }
.hours { display: flex; justify-content: space-between; margin-left: 46px; margin-right: 54px; font-size: .6875rem; color: var(--ink-2); margin-bottom: -10px; }
.wrow { display: flex; gap: 10px; align-items: flex-start; background: var(--card); border-radius: 12px; padding: 10px 10px; cursor: pointer; border: 1.5px solid transparent; }
.wrow.today { border-color: var(--acc); }
.wrow.past { opacity: .7; }
.wl { width: 36px; flex: none; display: flex; flex-direction: column; align-items: center; line-height: 1.15; }
.wl b { font-size: .75rem; text-transform: uppercase; color: var(--ink-2); font-weight: 500; }
.wl span { font-size: 1.15rem; font-weight: 600; }
.wrow.today .wl span { color: var(--acc); }
.wm { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 6px; }
.strip { position: relative; height: 14px; border-radius: 4px; background: var(--line-2); overflow: hidden; }
.strip i { position: absolute; top: 0; bottom: 0; border-radius: 3px; }
.strip .sx { background: var(--c); }
.strip .so { border: 1.5px solid var(--c); background: repeating-linear-gradient(135deg, color-mix(in srgb, var(--c) 40%, transparent) 0 2px, transparent 2px 5px); opacity: .85; }
.strip .sm { background: repeating-linear-gradient(135deg, var(--motiv) 0 2px, transparent 2px 4px); }
.strip u { position: absolute; top: -2px; bottom: -2px; width: 2px; background: var(--red); }
.wn { display: flex; flex-direction: column; gap: 2px; font-size: .875rem; }
.wn span { display: flex; gap: 6px; align-items: center; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
.wn .mt { color: var(--ink-2); }
.wr { width: 44px; flex: none; display: flex; flex-direction: column; gap: 4px; align-items: stretch; font-size: .75rem; text-align: right; color: var(--ink-2); padding-top: 1px; }

/* День */
.dhead { display: flex; flex-direction: column; gap: 6px; }
.someday { display: flex; flex-direction: column; gap: 6px; }
.someday h3 { font-size: .8125rem; color: var(--ink-2); font-weight: 500; text-transform: uppercase; letter-spacing: .05em; }
.tl { position: relative; margin-left: 44px; user-select: none; -webkit-user-select: none; touch-action: pan-y; }
.hl { position: absolute; left: 0; right: 0; border-top: 1px solid var(--line); }
.hl span { position: absolute; left: -44px; top: -9px; font-size: .75rem; color: var(--ink-2); font-variant-numeric: tabular-nums; }
.lane-x { position: absolute; top: 0; bottom: 0; left: 0; right: 34%; }
.lane-o { position: absolute; top: 0; bottom: 0; right: 0; width: 34%; }
.blk { position: absolute; border-radius: 8px; padding: 4px 7px; overflow: hidden; display: flex; flex-direction: column; font-size: .8125rem; line-height: 1.25; }
.blk b { font-weight: 600; overflow: hidden; text-overflow: ellipsis; }
.blk small { opacity: .85; font-size: .75rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.blk.x { background: var(--c); color: #fff; box-shadow: 0 0 0 1.5px var(--paper); z-index: 2; }
.blk.o { left: calc(var(--k) * 4px + 3px); right: 2px; border: 1.8px solid var(--c); background: repeating-linear-gradient(135deg, color-mix(in srgb, var(--c) 15%, var(--paper)) 0 6px, color-mix(in srgb, var(--paper) 85%, transparent) 6px 12px); color: var(--ink); z-index: 1; }
.blk.m { border: 1.5px dashed var(--motiv); background: color-mix(in srgb, var(--paper) 80%, transparent); color: var(--ink-2); z-index: 1; }
.gap { position: absolute; left: 0; right: 34%; display: grid; place-items: center; pointer-events: none; }
.gap span { font-size: .75rem; color: color-mix(in srgb, var(--acc) 70%, var(--ink-2)); background: var(--paper); padding: 1px 8px; border-radius: 999px; border: 1px dashed color-mix(in srgb, var(--acc) 40%, transparent); }
.now { position: absolute; left: -6px; right: 0; border-top: 2px solid var(--red); z-index: 3; pointer-events: none; }
.now::before { content: ''; position: absolute; left: -4px; top: -6px; width: 10px; height: 10px; border-radius: 50%; background: var(--red); }
.now span { position: absolute; left: -44px; top: -10px; font-size: .75rem; color: var(--red); font-weight: 700; background: var(--paper); }

/* Быстрая строка внизу */
.quick { position: fixed; left: 0; right: 0; bottom: 0; z-index: 6; background: var(--paper); border-top: 1px solid var(--line); padding: 8px 12px calc(8px + env(safe-area-inset-bottom)); }
.quick > * { max-width: 696px; margin-inline: auto; }
.qrow { display: flex; gap: 8px; }
.qrow input { flex: 1; min-width: 0; height: 48px; border-radius: 14px; border: 1.5px solid var(--line); background: var(--card); padding: 0 14px; font-size: 1rem; outline: none; }
.qrow input:focus { border-color: var(--ink); }
.qadd { width: 48px; height: 48px; border-radius: 14px; background: var(--ink); color: var(--paper); display: grid; place-items: center; flex: none; }
.qprev { display: flex; align-items: center; gap: 10px; padding: 0 2px 8px; font-size: .875rem; }
.qprev span { flex: 1; min-width: 0; }
.qx { padding: 5px 10px; border-radius: 999px; font-weight: 600; white-space: nowrap; font-size: .8125rem; }
.qx.x { background: var(--acc); color: #fff; }
.qx.o { border: 1.6px solid var(--acc); color: var(--acc); background: repeating-linear-gradient(135deg, var(--acc-l) 0 4px, transparent 4px 8px); }

/* Шторка события */
.sheet { position: fixed; inset: 0; z-index: 10; display: flex; align-items: flex-end; justify-content: center; }
.sh-bg { position: absolute; inset: 0; background: rgba(24, 25, 27, .42); }
.sh { position: relative; width: 100%; max-width: 560px; max-height: 94dvh; overflow: auto; overscroll-behavior: contain; background: var(--paper); border-radius: 18px 18px 0 0; padding: 10px 16px calc(18px + env(safe-area-inset-bottom)); display: flex; flex-direction: column; gap: 12px; animation: up var(--t-base, .22s) var(--ease-out, ease-out); }
@keyframes up { from { transform: translateY(30px); opacity: .4; } }
@media (min-width: 700px) { .sheet { align-items: center; } .sh { border-radius: 18px; } }
.sh-top { display: flex; align-items: center; justify-content: space-between; margin: 0 -8px; }
.sh-top span { width: 42px; }
.big-in { width: 100%; border: 0; border-bottom: 1.5px solid var(--line); background: transparent; font-size: 1.3rem; font-weight: 600; padding: 6px 2px; outline: none; }
.big-in:focus { border-color: var(--ink); }
.mode { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.mode button { display: flex; gap: 10px; align-items: center; padding: 11px 12px; border-radius: 12px; border: 1.5px solid var(--line); background: var(--card); }
.mode button .mk { width: 16px; height: 16px; }
.mode button .mk.o { border-width: 2px; }
.mode span { display: flex; flex-direction: column; line-height: 1.2; }
.mode small { font-size: .75rem; color: var(--ink-2); }
.mode button.on { border-color: var(--acc); box-shadow: inset 0 0 0 1px var(--acc); background: var(--acc-l); }
.f { display: flex; flex-direction: column; gap: 5px; }
.f > label, .fix > label { font-size: .8125rem; color: var(--ink-2); }
.f.two { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; align-items: end; }
.f.two > div { display: flex; flex-direction: column; gap: 5px; }
.f.two > div label { font-size: .8125rem; color: var(--ink-2); }
.f.two .tg { grid-column: 1 / -1; }
.f input:not([type=checkbox]), .f select, .f textarea { width: 100%; min-height: 44px; border-radius: 10px; border: 1.5px solid var(--line); background: var(--card); padding: 8px 10px; outline: none; }
.f input:focus, .f select:focus, .f textarea:focus { border-color: var(--ink); }
.f input:disabled { opacity: .45; }
.tg { display: flex; gap: 8px; align-items: center; font-size: .9375rem; }
.tg input { width: 20px; height: 20px; accent-color: var(--acc); }
.colors { display: flex; gap: 8px; flex-wrap: wrap; }
.cdot { width: 32px; height: 32px; border-radius: 50%; background: var(--c); border: 3px solid var(--paper); box-shadow: 0 0 0 1.5px transparent; }
.cdot.on { box-shadow: 0 0 0 2px var(--ink); }
.warn { font-size: .875rem; color: var(--red); background: var(--red-l); padding: 8px 10px; border-radius: 9px; }
.fix { display: flex; flex-direction: column; gap: 6px; padding: 10px; border-radius: 12px; background: var(--acc-l); }
.sh-act { display: flex; gap: 8px; }
.sh-act .btn { flex: 1; }
.task-t { font-size: 1.15rem; font-weight: 600; }

/* Настройки */
.set .card { background: var(--card); border-radius: 14px; padding: 16px; display: flex; flex-direction: column; gap: 12px; }
.set h2 { font-family: var(--head); font-size: 1.02rem; font-weight: 600; }
.set h3 { font-size: .875rem; color: var(--ink-2); font-weight: 500; margin-top: 4px; }
.apps { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.app-l { display: flex; flex-direction: column; gap: 2px; padding: 12px; border-radius: 12px; background: var(--ink); color: var(--paper); text-decoration: none; }
.app-l small { font-size: .75rem; opacity: .75; }
.app-l.off { background: var(--line-2); color: var(--ink-2); pointer-events: none; }
.imp, .trash, .log, .notes, .help { display: flex; flex-direction: column; gap: 5px; font-size: .9rem; }
.imp { max-height: 220px; overflow: auto; }
.notes li, .help li { padding-left: 14px; position: relative; }
.notes li::before, .help li::before { content: '·'; position: absolute; left: 3px; }
.trash li { display: flex; justify-content: space-between; gap: 10px; }

/* Вход */
.login { align-items: center; text-align: center; padding-top: calc(env(safe-area-inset-top) + 16vh); }
.login .logo { display: flex; gap: 8px; }
.login .logo .mk { width: 22px; height: 22px; }
.login .logo .mk.o { border-width: 3px; }
.login h1 { font-family: var(--head); font-size: 2.2rem; }
.login form { display: flex; flex-direction: column; gap: 10px; width: 100%; max-width: 320px; }
.login input { height: 48px; border-radius: 12px; border: 1.5px solid var(--line); background: var(--card); padding: 0 14px; }

.toast { position: fixed; left: 50%; bottom: calc(var(--quick) + env(safe-area-inset-bottom) + 14px); translate: -50% 0; z-index: 20; max-width: calc(100% - 28px); width: max-content; background: var(--ink); color: var(--paper); padding: 11px 16px; border-radius: 11px; font-size: .9375rem; }
.toast .link { color: #9ee0d6; margin-left: 6px; }
.skeleton { background: var(--line-2); border-radius: 12px; color: transparent; }
.sk-big { height: 300px; margin-top: 70px; }
.sk-card { height: 90px; }

/* Компьютер: шире, месяц крупнее */
@media (min-width: 900px) {
  #app { max-width: 980px; }
  .cell { aspect-ratio: 1.35 / 1; align-items: flex-start; }
  .cell .marks { justify-content: flex-start; }
  .cell .marks { display: none; }
  .cell .chips { display: flex; }
}
.chips { display: none; flex: 1; flex-direction: column; gap: 2px; width: 100%; min-width: 0; overflow: hidden; }
.chip { display: block; font-size: .6875rem; line-height: 1.35; padding: 0 5px; border-radius: 5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; text-align: left; }
.chip.x { background: var(--c); color: #fff; }
.chip.x small { opacity: .8; font-size: inherit; }
.chip.o { border: 1.3px solid var(--c); color: var(--ink); background: repeating-linear-gradient(135deg, color-mix(in srgb, var(--c) 16%, var(--card)) 0 4px, var(--card) 4px 8px); }
.chip.m { color: var(--ink-2); border: 1px dashed color-mix(in srgb, var(--motiv, #8A9A8C) 70%, transparent); }
.chips em { font-style: normal; font-size: .625rem; color: var(--ink-2); text-align: left; padding-left: 5px; }
@media (prefers-reduced-motion: reduce) { .sh { animation: none; } }
