/* Blogger Sans — © 2014 Sergiy S. Tkachenko, CC BY-ND 4.0 (см. /static/fonts/LICENSE.txt) */
@font-face { font-family: "Blogger Sans"; src: url("/static/fonts/BloggerSans-Regular.woff2") format("woff2"); font-weight: 400; font-style: normal; font-display: swap; }
@font-face { font-family: "Blogger Sans"; src: url("/static/fonts/BloggerSans-Medium.woff2") format("woff2"); font-weight: 500; font-style: normal; font-display: swap; }
@font-face { font-family: "Blogger Sans"; src: url("/static/fonts/BloggerSans-Bold.woff2") format("woff2"); font-weight: 700; font-style: normal; font-display: swap; }
@font-face { font-family: "Blogger Sans"; src: url("/static/fonts/BloggerSans-Italic.woff2") format("woff2"); font-weight: 400; font-style: italic; font-display: swap; }

/* Фирменная тёмная тема, как на сайте: в любой теме Telegram приложение выглядит одинаково */
:root {
  --bg: #1d232c;
  --surface: #2a3340;
  --text: #f3ede6;
  --muted: #b9b0ab;
  --accent: #e6bc6c;
  --accent-text: #1d1a16;
  --line: rgba(243, 237, 230, .12);
  --danger: #d9505a;
  --blue: #5a8ce0;
  --gold: #e6bc6c;
  --display: "Blogger Sans", "Jost", system-ui, sans-serif;
}
* { box-sizing: border-box; }
body { margin: 0; background: var(--bg); color: var(--text); font: 400 16px/1.55 "Blogger Sans", "Jost", -apple-system, system-ui, "Segoe UI", Roboto, sans-serif; padding-bottom: 24px; }
a { color: var(--text); }
h2 { font-family: var(--display); font-weight: 400; font-size: 30px; margin: 0 0 12px; line-height: 1.05; }
h3 { font-family: var(--display); font-weight: 500; font-size: 23px; margin: 0 0 8px; line-height: 1.15; }
.card { border: 1px solid var(--line); }
.top img { border-radius: 50%; }
p { margin: 0 0 12px; }
.muted { color: var(--muted); }

.top { display: flex; align-items: center; gap: 12px; padding: 16px; }
.top div { display: flex; flex-direction: column; line-height: 1.2; }
.top b { font-family: var(--display); font-weight: 400; font-size: 22px; }
.top small { color: var(--muted); font-size: 13px; }

.tabs { position: sticky; top: 0; z-index: 2; display: flex; gap: 4px; padding: 8px 16px; background: var(--bg); overflow-x: auto; }
.tabs button { flex: 1; min-height: 40px; border: 0; border-radius: 10px; background: transparent; color: var(--muted); font: inherit; font-weight: 600; font-size: 15px; cursor: pointer; white-space: nowrap; padding: 0 12px; }
.tabs button[aria-selected="true"] { background: var(--surface); color: var(--text); }

main { padding: 8px 16px; }
.card { background: var(--surface); border-radius: 8px; padding: 16px; margin-bottom: 12px; }
.card p:last-child { margin-bottom: 0; }
.card--tap { display: block; width: 100%; text-align: left; border: 0; font: inherit; color: inherit; cursor: pointer; }
.price { font-family: var(--display); font-size: 24px; margin: 8px 0 0; }
.meta { color: var(--muted); font-size: 14px; }
.chips { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 12px; }
.chips span { background: var(--surface); border-radius: 999px; padding: 6px 12px; font-size: 14px; }
.callout { border-left: 3px solid var(--danger); }
.text p { white-space: pre-line; }
.article h2 { font-size: 18px; margin-top: 20px; }
.article ul { padding-left: 20px; }

.btn { display: inline-flex; align-items: center; justify-content: center; min-height: 44px; padding: 10px 18px; border-radius: 999px; border: 0; background: var(--accent); color: var(--accent-text); font: inherit; font-weight: 600; cursor: pointer; text-decoration: none; }
.btn--ghost { background: transparent; color: var(--accent); box-shadow: inset 0 0 0 1px var(--line); }
.btn--block { width: 100%; margin-top: 12px; }
.btn[disabled] { opacity: .6; }

details { background: var(--surface); border-radius: 8px; padding: 4px 16px; margin-bottom: 8px; }
summary { padding: 12px 0; font-weight: 600; cursor: pointer; }
details p { color: var(--muted); }

.skeleton { height: 88px; border-radius: 8px; background: var(--surface); margin-bottom: 12px; animation: pulse 1.2s ease-in-out infinite; }
.skeleton.short { height: 48px; width: 60%; }
@keyframes pulse { 50% { opacity: .5; } }
@media (prefers-reduced-motion: reduce) { .skeleton { animation: none; } }

dialog { border: 0; border-radius: 18px 18px 0 0; padding: 20px 16px calc(20px + env(safe-area-inset-bottom)); width: 100%; max-width: 560px; margin: auto auto 0; background: var(--bg); color: var(--text); }
dialog::backdrop { background: rgba(0, 0, 0, .45); }
label { display: block; font-weight: 600; font-size: 14px; margin: 12px 0 6px; }
input:not([type=checkbox]) { width: 100%; min-height: 44px; padding: 10px 12px; border-radius: 10px; border: 1px solid var(--line); background: var(--surface); color: var(--text); font: inherit; }
.hint { color: var(--muted); font-size: 13px; margin-top: 6px; }
.check { display: flex; gap: 10px; align-items: flex-start; font-weight: 400; }
.check input { margin-top: 4px; width: 18px; height: 18px; }
.error { color: var(--danger); font-size: 14px; min-height: 20px; margin: 8px 0 0; }
.row { display: flex; gap: 8px; margin-top: 12px; }
.row .btn { flex: 1; }
.done { text-align: center; padding: 32px 16px; }

.app-hero { width: 100%; max-width: 420px; margin: -8px auto -64px; aspect-ratio: 1;
  -webkit-mask-image: radial-gradient(circle, #000 40%, transparent 70%); mask-image: radial-gradient(circle, #000 40%, transparent 70%); }
.card--hero { position: relative; background: rgba(42, 51, 64, .78); backdrop-filter: blur(6px); }
.app-hero img { display: block; width: 100%; height: 100%; object-fit: cover; }

/* ---------- Личный кабинет ---------- */
.rise { opacity: 0; transform: translateY(14px); animation: rise .6s cubic-bezier(.22, .7, .2, 1) forwards; animation-delay: calc(var(--i, 0) * 70ms); }
@keyframes rise { to { opacity: 1; transform: none; } }

.hello { display: flex; align-items: center; gap: 14px; margin: 4px 0 16px; }
.hello p { margin: 0; font-size: 13px; }
.hello h2 { margin: 0; }
.avatar { flex: none; width: 52px; height: 52px; border-radius: 50%; display: grid; place-items: center; font-family: var(--display); font-size: 26px; color: #fff;
  background: linear-gradient(135deg, var(--blue), var(--danger)); box-shadow: 0 0 24px rgba(90, 140, 224, .35); }

.next { position: relative; overflow: hidden;
  background: radial-gradient(90% 120% at 0% 0%, rgba(90, 140, 224, .22), transparent 60%), radial-gradient(80% 120% at 100% 100%, rgba(217, 80, 90, .18), transparent 60%), var(--surface); }
.next .muted { margin-bottom: 4px; font-size: 13px; }
.next__date { font-family: var(--display); font-size: 40px; line-height: 1; margin: 0 0 10px; }
.next__date span { display: block; font-family: "Onest", sans-serif; font-size: 15px; color: var(--muted); margin-top: 6px; }
.chip { display: inline-block; font-size: 13px; padding: 5px 10px; border-radius: 999px; border: 1px solid var(--line); color: var(--muted); }
.chip--glow { border-color: rgba(90, 140, 224, .5); color: var(--text); box-shadow: 0 0 16px rgba(90, 140, 224, .25); animation: pulse 2.6s ease-in-out infinite; }
.chip--up { border-color: rgba(90, 140, 224, .5); color: var(--blue); }
@keyframes pulse { 50% { box-shadow: 0 0 26px rgba(90, 140, 224, .45); } }

.tiles { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin-bottom: 12px; }
.tile { background: var(--surface); border: 1px solid var(--line); border-radius: 8px; padding: 12px 10px; display: flex; flex-direction: column; gap: 2px; }
.tile b { font-family: var(--display); font-weight: 500; font-size: 30px; line-height: 1; }
.tile b small { font-size: 15px; color: var(--muted); }
.tile span { font-size: 12px; color: var(--muted); line-height: 1.3; }

.card__head { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-bottom: 8px; }
.card__head h3 { margin: 0; }
.chart { width: 100%; height: auto; display: block; margin-top: 4px; overflow: visible; }
.chart__grid { stroke: var(--line); stroke-width: 1; stroke-dasharray: 2 4; }
.chart__line { fill: none; stroke: url(#cl); stroke-width: 2.5; stroke-linecap: round; stroke-linejoin: round;
  stroke-dasharray: 1; stroke-dashoffset: 1; animation: draw 1.4s cubic-bezier(.6, .1, .3, 1) .35s forwards; }
.chart__area { opacity: 0; animation: fade .8s ease 1.2s forwards; }
.chart__dot { fill: var(--bg); stroke: var(--text); stroke-width: 1.5; opacity: 0; animation: fade .4s ease 1.3s forwards; }
.chart__dot--last { fill: var(--danger); stroke: #fff; filter: drop-shadow(0 0 6px rgba(217, 80, 90, .8)); }
.chart__axis { display: flex; justify-content: space-between; font-size: 12px; color: var(--muted); margin-top: 4px; }
@keyframes draw { to { stroke-dashoffset: 0; } }
@keyframes fade { to { opacity: 1; } }

.notes { list-style: none; margin: 0; padding: 0; }
.notes li { padding: 12px 0; border-top: 1px solid var(--line); }
.notes li:first-child { border-top: 0; padding-top: 4px; }
.notes__head { display: flex; justify-content: space-between; align-items: center; font-size: 13px; margin-bottom: 4px; }
.notes p { margin: 0; }
.score-badge { font-weight: 500; font-size: 13px; padding: 2px 8px; border-radius: 999px; background: rgba(90, 140, 224, .16); color: var(--text); }

.timeline { list-style: none; margin: 0; padding: 0 0 0 18px; position: relative; }
.timeline::before { content: ""; position: absolute; left: 4px; top: 6px; bottom: 6px; width: 1px; background: linear-gradient(var(--blue), var(--danger)); }
.timeline__item { position: relative; padding: 0 0 14px; display: grid; grid-template-columns: 1fr auto; column-gap: 8px; }
.timeline__item::before { content: ""; position: absolute; left: -18px; top: 5px; width: 9px; height: 9px; border-radius: 50%; background: var(--bg); border: 1.5px solid var(--muted); }
.timeline__item--done::before { background: var(--text); border-color: var(--text); }
.timeline__item--upcoming::before { background: var(--blue); border-color: var(--blue); box-shadow: 0 0 10px var(--blue); }
.timeline__item b { font-weight: 500; font-size: 15px; }
.timeline__item span { grid-column: 1; color: var(--muted); font-size: 14px; }
.timeline__item em { grid-row: 1; grid-column: 2; font-style: normal; font-size: 12px; color: var(--muted); }
.timeline__item--cancelled b, .timeline__item--cancelled span { opacity: .55; text-decoration: line-through; }

.invite { border-color: transparent; background: linear-gradient(var(--surface), var(--surface)) padding-box, linear-gradient(120deg, var(--blue), var(--danger)) border-box; }
.invite__link { display: flex; gap: 8px; margin: 12px 0 0; }
.invite__link input { flex: 1; min-width: 0; font-size: 13px; color: var(--muted); }
.invite__link .btn { flex: none; padding: 10px 14px; font-size: 14px; }
.invite__stats { display: flex; gap: 16px; margin-top: 12px; font-size: 13px; color: var(--muted); }
.invite__stats b { color: var(--text); font-size: 18px; margin-right: 4px; }

/* Оценка ползунком */
.score { margin: 12px 0 4px; text-align: center; }
.score output { display: block; font-family: var(--display); font-size: 64px; line-height: 1; background: linear-gradient(120deg, var(--blue), var(--danger)); -webkit-background-clip: text; background-clip: text; color: transparent; }
.score input[type=range] { width: 100%; margin: 12px 0 4px; appearance: none; -webkit-appearance: none; height: 6px; border-radius: 999px;
  background: linear-gradient(90deg, var(--blue), var(--danger)) 0 / var(--fill, 50%) 100% no-repeat, var(--line); }
.score input[type=range]::-webkit-slider-thumb { -webkit-appearance: none; width: 28px; height: 28px; border-radius: 50%; background: #fff; box-shadow: 0 0 0 4px rgba(90, 140, 224, .35); }
.score input[type=range]::-moz-range-thumb { width: 28px; height: 28px; border: 0; border-radius: 50%; background: #fff; }
.score__ends { display: flex; justify-content: space-between; font-size: 12px; color: var(--muted); }
textarea { width: 100%; padding: 10px 12px; border-radius: 10px; border: 1px solid var(--line); background: var(--surface); color: var(--text); font: inherit; resize: vertical; }

@media (prefers-reduced-motion: reduce) {
  .rise, .chart__line, .chart__area, .chart__dot, .chip--glow { animation: none; opacity: 1; transform: none; stroke-dashoffset: 0; }
}

/* Палитра картинки: туман, золото */
body { background: radial-gradient(80% 40% at 50% 0%, #3a4552, transparent 70%), radial-gradient(70% 40% at 0% 100%, rgba(95, 140, 116, .22), transparent 70%), var(--bg); background-attachment: fixed; }
.chip--up { border-color: rgba(166, 194, 173, .55); color: #a6c2ad; }
.score-badge { background: rgba(95, 140, 116, .28); }
.btn:not(.btn--ghost) { background: linear-gradient(135deg, #f4d898, var(--gold) 45%, #b8873e); }
.chart__dot--last { fill: var(--gold); filter: drop-shadow(0 0 6px rgba(230, 188, 108, .8)); }
.chip--glow { border-color: rgba(230, 188, 108, .55); box-shadow: 0 0 16px rgba(230, 188, 108, .25); }

.card--post { padding: 0; overflow: hidden; }
.card--post img { display: block; width: 100%; aspect-ratio: 16 / 9; object-fit: cover; }
.card--post h3, .card--post p { padding: 0 16px; }
.card--post h3 { margin-top: 14px; }
.card--post p { padding-bottom: 16px; }
