/* Дневник. Строгий чёрно-белый; цвет — только там, где он значит: прыжки (жёлтый), поле (зелёный), шкала.
   Сетка отступов шаг 4; шрифт: заголовки — с засечками, текст — системный. Телефон — главный. */
:root {
  --font: -apple-system, BlinkMacSystemFont, "SF Pro Text", "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --serif: "Iowan Old Style", "Palatino Linotype", Palatino, Georgia, "Times New Roman", serif;
  --s1: 4px; --s2: 8px; --s3: 12px; --s4: 16px; --s5: 24px; --s6: 32px;
  --bg: #f4f3f0; --surface: #ffffff; --fill: #ecebe7; --fill-2: #dddbd5;
  --ink: #111111; --ink-2: #555350; --ink-3: #8d8a84; --sep: rgba(0, 0, 0, .09);
  --jump: #f2c12e; --jump-ink: #5b4500; --field: #3f9a5e; --field-ink: #ffffff;
  --accent: #111111; --on-accent: #ffffff;
  --shadow: 0 1px 2px rgba(0,0,0,.04), 0 6px 24px rgba(0,0,0,.05);
  color-scheme: light dark;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0c0c0c; --surface: #171717; --fill: #232323; --fill-2: #333333;
    --ink: #f3f2ee; --ink-2: #b7b4ad; --ink-3: #7d7a74; --sep: rgba(255, 255, 255, .09);
    --jump: #e8b923; --jump-ink: #2b2000; --field: #3c9a5c; --field-ink: #ffffff;
    --accent: #f3f2ee; --on-accent: #111111;
    --shadow: none;
  }
}
* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { margin: 0; background: var(--bg); color: var(--ink); font: 400 16px/1.45 var(--font); -webkit-font-smoothing: antialiased; }
button { font: inherit; color: inherit; background: none; border: 0; padding: 0; cursor: pointer; }
a { color: inherit; }
svg { width: 22px; height: 22px; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; flex: none; }
h1, h2, h3 { font-family: var(--serif); font-weight: 600; letter-spacing: -.01em; margin: 0; }
h1 { font-size: 30px; line-height: 1.12; }
h2 { font-size: 20px; line-height: 1.25; }
.muted { color: var(--ink-3); font-size: 13px; }
.main { max-width: 640px; margin: 0 auto; padding: 0 var(--s4) calc(96px + env(safe-area-inset-bottom)); }

/* шапка с картинкой Веры: чёрно-белая, приглушённая, на ней — название и шкала */
.hero { position: relative; margin: 0 calc(-1 * var(--s4)); padding: calc(var(--s5) + env(safe-area-inset-top)) var(--s4) var(--s5);
  color: #fff; background: #111 center 30% / cover no-repeat; min-height: 270px; display: flex; flex-direction: column; justify-content: space-between; }
.hero::before { content: ""; position: absolute; inset: 0; background: linear-gradient(to bottom, rgba(0,0,0,.62), rgba(0,0,0,.18) 38%, rgba(0,0,0,.28) 55%, rgba(0,0,0,.78)); }
.hero > * { position: relative; }
.hero .brand b { display: block; font-family: var(--serif); font-size: 26px; font-weight: 600; letter-spacing: .01em; }
.hero .brand span { font-size: 12px; letter-spacing: .22em; text-transform: uppercase; opacity: .75; }
.scale .day { font-family: var(--serif); font-size: 34px; line-height: 1.05; }
.scale .day small { font-family: var(--font); font-size: 15px; opacity: .8; margin-left: 6px; }
.scale .goal { margin-top: var(--s1); font-size: 15px; opacity: .92; }
.scale .bar { position: relative; height: 6px; border-radius: 3px; background: rgba(255,255,255,.22); margin: var(--s3) 0 var(--s2); overflow: visible; }
.scale .bar i { position: absolute; left: 0; top: 0; bottom: 0; border-radius: 3px; background: linear-gradient(90deg, var(--field), var(--jump)); }
.scale .bar b { position: absolute; top: -5px; width: 16px; height: 16px; margin-left: -8px; border-radius: 50%; background: #fff; box-shadow: 0 0 0 4px rgba(255,255,255,.18); }
.scale .ends { display: flex; justify-content: space-between; font-size: 12px; opacity: .7; }

.card { background: var(--surface); border-radius: 18px; box-shadow: var(--shadow); padding: var(--s4); margin: var(--s4) 0; }
.kicker { font-size: 12px; letter-spacing: .14em; text-transform: uppercase; color: var(--ink-3); font-weight: 600; margin-bottom: var(--s2); }
.plan ol { margin: 0; padding-left: 20px; }
.plan li { margin: 0 0 6px; }
.plan li::marker { color: var(--ink-3); }
.plan .from { margin-top: var(--s2); }
.more { color: var(--ink); font-weight: 600; margin-top: var(--s2); display: inline-flex; align-items: center; gap: 2px; border-bottom: 1px solid var(--fill-2); }

/* календарь */
.cal-h { display: flex; align-items: center; justify-content: space-between; margin-bottom: var(--s3); }
.cal-h h2 { font-size: 18px; }
.iconbtn { width: 40px; height: 40px; border-radius: 20px; display: grid; place-items: center; color: var(--ink-2); }
.iconbtn:active { background: var(--fill); }
.cal { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 6px; }
.cal .wd { text-align: center; font-size: 12px; color: var(--ink-3); padding-bottom: 2px; }
.cal .d { aspect-ratio: 1; border-radius: 12px; display: grid; place-items: center; font-size: 15px; font-weight: 500; background: var(--fill); position: relative; overflow: hidden; }
.cal .d.out { background: none; }
.cal .d.j { background: var(--jump); color: var(--jump-ink); font-weight: 650; }
.cal .d.f { background: var(--field); color: var(--field-ink); font-weight: 650; }
.cal .d.jf { background: linear-gradient(135deg, var(--jump) 50%, var(--field) 50%); color: var(--ink); font-weight: 650; }
.cal .d.jf span { background: var(--surface); border-radius: 8px; padding: 0 5px; }
.cal .d.today { box-shadow: inset 0 0 0 2px var(--ink); }
.cal .d.rec::after { content: ""; position: absolute; bottom: 5px; width: 4px; height: 4px; border-radius: 2px; background: currentColor; opacity: .55; }
.cal .d.before { opacity: .45; }
.legend { display: flex; gap: var(--s4); margin-top: var(--s3); font-size: 13px; color: var(--ink-2); }
.legend i { display: inline-block; width: 12px; height: 12px; border-radius: 4px; margin-right: 6px; vertical-align: -1px; }

/* лента и списки */
.feed .item { display: flex; gap: var(--s3); align-items: center; padding: var(--s3) 0; border-top: 1px solid var(--sep); cursor: pointer; }
.feed .item:first-of-type { border-top: 0; padding-top: 0; }
.feed .item .t { flex: 1; min-width: 0; }
.feed .item b { display: block; font-weight: 600; }
.feed .item small { display: block; color: var(--ink-2); font-size: 14px; overflow: hidden; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
.thumb { width: 64px; height: 64px; border-radius: 12px; object-fit: cover; background: var(--fill); flex: none; filter: grayscale(1); }
.dot { display: inline-block; width: 8px; height: 8px; border-radius: 4px; margin-right: 4px; vertical-align: 1px; }
.dot.j { background: var(--jump); } .dot.f { background: var(--field); }
.list .row { display: flex; gap: var(--s3); padding: var(--s4) 0; border-top: 1px solid var(--sep); cursor: pointer; align-items: flex-start; }
.list .row:first-child { border-top: 0; }
.list .date { width: 56px; flex: none; text-align: center; }
.list .date b { display: block; font-family: var(--serif); font-size: 26px; line-height: 1; }
.list .date small { font-size: 12px; color: var(--ink-3); text-transform: lowercase; }
.list .t { flex: 1; min-width: 0; }
.list .t b { font-weight: 600; }
.list .t small { display: block; color: var(--ink-2); font-size: 14px; margin-top: 2px; overflow: hidden; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
.pagehead { padding: calc(var(--s4) + env(safe-area-inset-top)) 0 var(--s2); }
.back { display: inline-flex; align-items: center; gap: 2px; color: var(--ink-2); height: 40px; margin-left: -6px; }
.pagehead h1 { margin-top: var(--s1); }
.meta { display: flex; flex-wrap: wrap; gap: var(--s2) var(--s4); margin: var(--s3) 0 var(--s2); color: var(--ink-2); font-size: 14px; }
.meta { flex-direction: column; gap: var(--s1); }
.meta span b { color: var(--ink); font-weight: 500; }

/* запись */
.marks { display: flex; gap: var(--s2); margin: var(--s3) 0; }
.tog { flex: 1; height: 44px; border-radius: 12px; display: flex; align-items: center; justify-content: center; gap: var(--s2);
  background: var(--fill); color: var(--ink-2); font-weight: 600; font-size: 15px; }
.tog i { width: 14px; height: 14px; border-radius: 50%; border: 2px solid currentColor; }
.tog.j.on { background: var(--jump); color: var(--jump-ink); }
.tog.f.on { background: var(--field); color: var(--field-ink); }
.tog.on i { background: currentColor; }
.tog.ro { pointer-events: none; }
.sec { margin: var(--s5) 0 0; }
.sec h3 { font-size: 17px; margin-bottom: var(--s2); }
.sec ul { margin: 0; padding-left: 18px; }
.sec li { margin: 0 0 var(--s2); }
.sec li b { font-weight: 650; }
.sec p { margin: 0 0 var(--s2); }
.quote { font-family: var(--serif); font-size: 17px; line-height: 1.5; }

/* видео */
.player { width: 100%; border-radius: 16px; background: #000; display: block; max-height: 56vh; object-fit: contain; }   /* пропорции — самого ролика: вертикальный не сжимается в широкую рамку */
.player.tall { aspect-ratio: 9 / 16; max-height: 70vh; }
.points { margin-top: var(--s4); }
.pt { display: flex; gap: var(--s3); padding: var(--s3) 0; border-top: 1px solid var(--sep); align-items: baseline; }
.pt:first-child { border-top: 0; }
.pt .tm { flex: none; min-width: 52px; height: 28px; border-radius: 14px; background: var(--ink); color: var(--bg); font-size: 13px; font-weight: 650;
  display: inline-grid; place-items: center; font-variant-numeric: tabular-nums; cursor: pointer; }
.pt .tm.none { background: none; }
.pt p { margin: 0; flex: 1; }

/* дома */
.week { display: flex; justify-content: space-between; gap: var(--s1); margin-top: var(--s3); }
.week button { flex: 1; display: flex; flex-direction: column; align-items: center; gap: 6px; font-size: 12px; color: var(--ink-3); }
.week button i { width: 36px; height: 36px; border-radius: 50%; border: 2px solid var(--fill-2); display: grid; place-items: center; }
.week button.on i { background: var(--ink); border-color: var(--ink); color: var(--bg); }
.week button.on i::after { content: "✓"; font-style: normal; font-weight: 700; font-size: 16px; }
.week button.today { color: var(--ink); font-weight: 650; }
.week.ro button { pointer-events: none; }
.timer { text-align: center; padding: var(--s3) 0 var(--s2); }
.timer .clock { font-family: var(--serif); font-size: 64px; line-height: 1; font-variant-numeric: tabular-nums; letter-spacing: -.02em; }
.timer .best { margin-top: var(--s2); }
.bigbtn { width: 100%; height: 56px; border-radius: 16px; background: var(--accent); color: var(--on-accent); font-weight: 650; font-size: 17px; margin-top: var(--s4); }
.bigbtn.stop { background: var(--jump); color: var(--jump-ink); }
.chart { display: flex; align-items: flex-end; gap: 4px; height: 140px; margin-top: var(--s3); }
.chart .c { flex: 1; min-width: 0; display: flex; flex-direction: column; justify-content: flex-end; align-items: center; height: 100%; }
.chart .c i { width: 100%; max-width: 22px; border-radius: 4px 4px 0 0; background: var(--ink); }
.chart .c.best i { background: var(--jump); }
.chart .c span { font-size: 10px; color: var(--ink-3); margin-top: 4px; }
.chart .c em { font-style: normal; font-size: 10px; color: var(--ink-2); margin-bottom: 2px; }
.att { display: flex; justify-content: space-between; padding: var(--s2) 0; border-top: 1px solid var(--sep); font-size: 15px; }
.att:first-child { border-top: 0; }
.att small { color: var(--ink-3); }
.att > span:last-child { flex: none; white-space: nowrap; margin-left: var(--s3); }
.att button { color: var(--ink-3); font-size: 13px; margin-left: var(--s3); }

/* читать */
.tag { display: inline-block; font-size: 11px; letter-spacing: .12em; text-transform: uppercase; font-weight: 650; padding: 3px 8px; border-radius: 6px;
  background: var(--fill); color: var(--ink-2); }
.tag.grow { background: var(--ink); color: var(--bg); }
.list .row.read { opacity: .55; }
.why { font-family: var(--serif); font-style: italic; font-size: 18px; line-height: 1.45; margin: var(--s4) 0; color: var(--ink); }
.embed { width: 100%; aspect-ratio: 16 / 9; border: 0; border-radius: 16px; background: #000; margin: var(--s3) 0; }
.linkbtn { display: flex; align-items: center; justify-content: center; gap: var(--s2); height: 52px; border-radius: 14px; border: 1.5px solid var(--ink);
  text-decoration: none; font-weight: 650; margin: var(--s3) 0; }
.readbtn { width: 100%; height: 52px; border-radius: 14px; background: var(--fill); font-weight: 650; margin-top: var(--s2); }
.readbtn.on { background: var(--ink); color: var(--bg); }

/* шторка: отметки дня без записи */
.scrim { position: fixed; inset: 0; background: rgba(0,0,0,.45); z-index: 50; }
.sheet { position: fixed; left: 0; right: 0; bottom: 0; z-index: 51; background: var(--surface); border-radius: 22px 22px 0 0;
  padding: var(--s2) var(--s4) calc(var(--s5) + env(safe-area-inset-bottom)); max-width: 640px; margin: 0 auto; }
.grab { width: 36px; height: 5px; border-radius: 3px; background: var(--fill-2); margin: 0 auto var(--s4); }

/* нижние вкладки */
.tabs { position: fixed; left: 0; right: 0; bottom: 0; z-index: 40; display: grid; grid-template-columns: repeat(5, 1fr);
  padding: 6px 0 calc(8px + env(safe-area-inset-bottom)); border-top: 1px solid var(--sep);
  background: color-mix(in srgb, var(--bg) 88%, transparent); backdrop-filter: blur(18px); -webkit-backdrop-filter: blur(18px); }
.tabs button { display: flex; flex-direction: column; align-items: center; gap: 2px; font-size: 11px; color: var(--ink-3); }
.tabs button.on { color: var(--ink); font-weight: 650; }
.tabs svg { width: 24px; height: 24px; }

/* вход */
.login { max-width: 420px; margin: 0 auto; padding: calc(64px + env(safe-area-inset-top)) var(--s5) var(--s5); }
.login .logo { width: 72px; height: 72px; border-radius: 18px; }
.login h1 { margin: var(--s4) 0 var(--s1); }
.field { display: block; margin-top: var(--s4); }
.field span { display: block; font-size: 13px; color: var(--ink-3); margin-bottom: 6px; }
.field input { width: 100%; height: 50px; border-radius: 12px; border: 1.5px solid var(--fill-2); background: var(--surface); color: var(--ink); padding: 0 var(--s3); font: inherit; }
.seg { display: flex; gap: 4px; background: var(--fill); border-radius: 12px; padding: 4px; }
.seg button { flex: 1; height: 42px; border-radius: 9px; font-weight: 600; color: var(--ink-2); }
.seg button.on { background: var(--surface); color: var(--ink); box-shadow: 0 1px 3px rgba(0,0,0,.12); }
.err { color: #c0392b; font-size: 14px; margin-top: var(--s3); min-height: 20px; }
.empty { color: var(--ink-3); text-align: center; padding: var(--s6) var(--s4); }
.toast { position: fixed; left: 50%; bottom: 100px; translate: -50% 0; background: var(--ink); color: var(--bg); padding: 10px 16px; border-radius: 12px; z-index: 60; font-size: 15px; }
@media (prefers-reduced-motion: no-preference) { .card, .list .row { animation: rise .35s ease both; } @keyframes rise { from { opacity: 0; transform: translateY(6px); } } }
