/* Сайт-визитка WeSpending. Цвета взяты у свинки-копилки: бирюзовый — её лапы, кремовый — фон картинок. */
/* Шрифт Nunito лежит на нашем сервере (папка fonts, файлы из пакета @fontsource/nunito), а не на Google Fonts:
   стили Google в шапке держали страницу пустой, если запрос подвисал (#138). Только кириллица и латиница. */
@font-face { font-family: 'Nunito'; font-style: normal; font-weight: 400; font-display: swap; src: url('/fonts/nunito-cyrillic-400-normal.woff2') format('woff2'); unicode-range: U+0301,U+0400-045F,U+0490-0491,U+04B0-04B1,U+2116; }
@font-face { font-family: 'Nunito'; font-style: normal; font-weight: 400; font-display: swap; src: url('/fonts/nunito-latin-400-normal.woff2') format('woff2'); unicode-range: U+0000-00FF,U+0131,U+0152-0153,U+02BB-02BC,U+02C6,U+02DA,U+02DC,U+0304,U+0308,U+0329,U+2000-206F,U+20AC,U+2122,U+2191,U+2193,U+2212,U+2215,U+FEFF,U+FFFD; }
@font-face { font-family: 'Nunito'; font-style: normal; font-weight: 700; font-display: swap; src: url('/fonts/nunito-cyrillic-700-normal.woff2') format('woff2'); unicode-range: U+0301,U+0400-045F,U+0490-0491,U+04B0-04B1,U+2116; }
@font-face { font-family: 'Nunito'; font-style: normal; font-weight: 700; font-display: swap; src: url('/fonts/nunito-latin-700-normal.woff2') format('woff2'); unicode-range: U+0000-00FF,U+0131,U+0152-0153,U+02BB-02BC,U+02C6,U+02DA,U+02DC,U+0304,U+0308,U+0329,U+2000-206F,U+20AC,U+2122,U+2191,U+2193,U+2212,U+2215,U+FEFF,U+FFFD; }
@font-face { font-family: 'Nunito'; font-style: normal; font-weight: 800; font-display: swap; src: url('/fonts/nunito-cyrillic-800-normal.woff2') format('woff2'); unicode-range: U+0301,U+0400-045F,U+0490-0491,U+04B0-04B1,U+2116; }
@font-face { font-family: 'Nunito'; font-style: normal; font-weight: 800; font-display: swap; src: url('/fonts/nunito-latin-800-normal.woff2') format('woff2'); unicode-range: U+0000-00FF,U+0131,U+0152-0153,U+02BB-02BC,U+02C6,U+02DA,U+02DC,U+0304,U+0308,U+0329,U+2000-206F,U+20AC,U+2122,U+2191,U+2193,U+2212,U+2215,U+FEFF,U+FFFD; }
@font-face { font-family: 'Nunito'; font-style: normal; font-weight: 900; font-display: swap; src: url('/fonts/nunito-cyrillic-900-normal.woff2') format('woff2'); unicode-range: U+0301,U+0400-045F,U+0490-0491,U+04B0-04B1,U+2116; }
@font-face { font-family: 'Nunito'; font-style: normal; font-weight: 900; font-display: swap; src: url('/fonts/nunito-latin-900-normal.woff2') format('woff2'); unicode-range: U+0000-00FF,U+0131,U+0152-0153,U+02BB-02BC,U+02C6,U+02DA,U+02DC,U+0304,U+0308,U+0329,U+2000-206F,U+20AC,U+2122,U+2191,U+2193,U+2212,U+2215,U+FEFF,U+FFFD; }

:root {
  --accent: #1f7a70;
  --accent-dark: #155e58;
  --accent-tint: #e6f3f0;
  --text: #10293a;
  --muted: #4a6273;
  --line: #dde9e6;
  --soft: #f5f9f8;
  --bubble: #eef5f3;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  background: #fff;
  color: var(--text);
  font-family: 'Nunito', system-ui, -apple-system, 'Segoe UI', sans-serif;
  font-size: 18px;
  line-height: 1.55;
  -webkit-text-size-adjust: 100%;
}
a { color: var(--accent); }
a:hover { color: var(--accent-dark); }
img { display: block; max-width: 100%; height: auto; }
h1, h2, h3 { margin: 0; line-height: 1.15; }
p { margin: 0; }

.wrap { max-width: 1200px; margin: 0 auto; padding: 0 24px; }
.muted { color: var(--muted); }

/* Шапка */
.nav { display: flex; flex-wrap: wrap; align-items: center; gap: 12px 28px; padding: 20px 0; border-bottom: 1px solid var(--line); }
.brand { display: flex; align-items: center; gap: 10px; margin-right: auto; color: var(--text); text-decoration: none; font-weight: 900; font-size: 22px; }
.brand img { width: 40px; height: 40px; border-radius: 10px; }
.nav-links { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 24px; font-weight: 700; font-size: 16px; }
.nav-links a { color: var(--text); text-decoration: none; }
.nav-links a:hover { color: var(--accent); }
.nav-links .lang { color: var(--accent); border: 2px solid #bfdcd6; border-radius: 8px; padding: 2px 8px; font-size: 14px; }

/* Кнопки */
.buttons { display: flex; flex-wrap: wrap; gap: 12px; }
.btn {
  display: inline-flex; align-items: center; gap: 10px;
  min-height: 52px; padding: 0 26px; border-radius: 14px;
  font-weight: 800; font-size: 18px; text-decoration: none;
  border: 2px solid var(--accent);
}
.btn svg { width: 22px; height: 22px; flex: none; }
.btn-primary { background: var(--accent); color: #fff; }
.btn-primary:hover { background: var(--accent-dark); border-color: var(--accent-dark); color: #fff; }
.btn-secondary { background: #fff; color: var(--accent-dark); }
.btn-secondary:hover { background: var(--accent-tint); color: var(--accent-dark); }
.btn-small { min-height: 44px; padding: 0 20px; font-size: 16px; }

/* Первый экран */
.hero { display: flex; flex-wrap: wrap; align-items: center; gap: 56px; padding: 56px 0 72px; }
.hero-text { flex: 1 1 460px; min-width: 0; display: flex; flex-direction: column; align-items: flex-start; gap: 24px; }
.pill { background: var(--accent-tint); color: var(--accent-dark); font-weight: 800; padding: 6px 18px; border-radius: 999px; }
.hero h1 { font-size: clamp(36px, 5vw, 60px); line-height: 1.08; font-weight: 900; }
.hero h1 span { color: var(--accent); }
.lead { font-size: clamp(18px, 1.8vw, 21px); color: var(--muted); max-width: 540px; }
.note { font-size: 15px; color: var(--muted); }

/* Пример чата, слева от него стоит свинка */
.chat-wrap { flex: 1 1 460px; min-width: 0; display: flex; align-items: flex-end; justify-content: center; gap: 8px; position: relative; }
/* Свинка на прозрачном фоне, мягкая тень снизу вместо фона картинки */
.mascot { display: block; flex: none; }
.mascot img { width: 100%; filter: drop-shadow(0 12px 14px rgba(16, 41, 58, 0.14)); }
.mascot-hero { width: 140px; margin: 0 -24px -8px 0; order: -1; position: relative; z-index: 1; }

/* Разделы */
.section { padding: 88px 0; }
.section-soft { background: var(--soft); }
.section-head { display: flex; flex-direction: column; gap: 10px; max-width: 640px; margin-bottom: 40px; }
.section h2 { font-size: clamp(30px, 3.6vw, 44px); font-weight: 900; }
.grid { display: grid; gap: 24px; grid-template-columns: repeat(auto-fit, minmax(min(100%, 300px), 1fr)); }

.step { background: var(--soft); border-radius: 20px; padding: 28px; display: flex; flex-direction: column; gap: 12px; }
.step-num { width: 44px; height: 44px; border-radius: 50%; background: var(--accent); color: #fff; font-weight: 900; font-size: 20px; display: flex; align-items: center; justify-content: center; }
.step h3, .card h3 { font-size: 22px; font-weight: 800; }

.card { border: 2px solid var(--line); border-radius: 20px; padding: 28px; display: flex; flex-direction: column; gap: 12px; }
.card svg { width: 36px; height: 36px; stroke: var(--accent); }

/* Скриншоты */

/* Данные */
.privacy-block { display: flex; flex-wrap: wrap; align-items: center; gap: 48px; }
.mascot-privacy { width: 280px; margin: 0 auto; }
.privacy-text { flex: 1 1 440px; min-width: 0; display: flex; flex-direction: column; gap: 18px; }

/* Вопросы */
.faq { max-width: 860px; }
.faq-list { display: flex; flex-direction: column; gap: 16px; }
.faq details { background: #fff; border-radius: 16px; padding: 22px 26px; }
.faq summary { font-size: 20px; font-weight: 800; cursor: pointer; list-style-position: outside; }
.faq details p { margin-top: 8px; color: var(--muted); }

/* Последний призыв */
.cta { background: var(--accent-tint); border-radius: 32px; padding: 48px; display: flex; flex-wrap: wrap; align-items: center; gap: 40px; }
.mascot-cta { width: 220px; }
.cta-text { flex: 1 1 400px; min-width: 0; display: flex; flex-direction: column; align-items: flex-start; gap: 18px; }
.cta h2 { font-size: clamp(28px, 3.4vw, 42px); font-weight: 900; }

/* Подвал */
.footer { border-top: 1px solid var(--line); padding: 32px 0 40px; font-size: 15px; color: var(--muted); }
.footer-row { display: flex; flex-wrap: wrap; align-items: center; gap: 12px 28px; }
.footer-row + .footer-row { margin-top: 16px; gap: 8px 20px; }
.footer-brand { display: flex; align-items: center; gap: 8px; margin-right: auto; font-weight: 800; color: var(--text); }
.footer-brand img { width: 28px; height: 28px; border-radius: 7px; }
.footer-author { margin-left: auto; }

/* Текстовые страницы */
.doc { max-width: 760px; padding: 64px 24px 96px; display: flex; flex-direction: column; gap: 28px; }
.doc h1 { font-size: clamp(32px, 4.5vw, 48px); font-weight: 900; }
.doc h2 { font-size: 26px; font-weight: 800; margin-bottom: 10px; }
.doc ul { margin: 0 0 10px; padding-left: 24px; display: flex; flex-direction: column; gap: 6px; }

@media (max-width: 640px) {
  body { font-size: 17px; }
  .nav-links { gap: 6px 18px; font-size: 15px; }
  .hero { padding: 32px 0 64px; gap: 32px; }
  /* На телефоне рядом с чатом места нет: свинка выглядывает из-за него сверху */
  .chat-wrap { flex-direction: column; align-items: center; gap: 0; }
  .chat-wrap { flex-basis: 100%; }
  .mascot-hero { width: 110px; margin: 0 0 -14px; position: relative; z-index: 1; }
  .section { padding: 64px 0; }
  .cta { padding: 32px 24px; }
  .mascot-cta { width: 170px; }
  .mascot-privacy { width: 200px; }
  .footer-author { margin-left: 0; }
  .btn { width: 100%; justify-content: center; }
}

/* «Проект развивается»: просьба писать замечания и идеи. */
.feedback { border: 2px solid var(--line); border-radius: 24px; padding: 32px; display: flex; flex-wrap: wrap; align-items: center; gap: 24px; }
.feedback > svg { width: 48px; height: 48px; stroke: var(--accent); flex: none; }
.feedback-text { flex: 1 1 360px; min-width: 0; display: flex; flex-direction: column; gap: 8px; }
.feedback h2 { font-size: clamp(24px, 2.6vw, 32px); font-weight: 900; }
@media (max-width: 640px) {
  .feedback { padding: 24px; gap: 16px; }
  .feedback > svg { width: 40px; height: 40px; }
}

/* «Как это выглядит»: четыре телефона вёрсткой — тёмный Telegram на iPhone, как у настоящих людей.
   Текст живой: названия чата, категорий и суммы правятся прямо в HTML. На узком экране ряд листается вбок. */
.phones { display: flex; gap: 28px; overflow-x: auto; scroll-snap-type: x mandatory; padding: 8px 4px 16px; margin: 0 -4px; justify-content: safe center; }
.phones figure { margin: 0; display: flex; flex-direction: column; align-items: center; gap: 14px; scroll-snap-align: center; flex: none; }
.phones figcaption { font-weight: 800; }
.phone {
  --tg-text: #f2f2f7; --tg-muted: #8e8e93;
  width: 262px; height: 556px; border-radius: 40px; border: 7px solid #10151b; position: relative; overflow: hidden;
  display: flex; flex-direction: column; font-size: 13px; line-height: 1.3; color: var(--tg-text);
  box-shadow: 0 18px 40px rgba(16, 41, 58, 0.22); text-align: left;
}
.phone svg { fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.tg-status { display: flex; justify-content: space-between; align-items: center; padding: 10px 22px 4px; font-size: 13px; }
.tg-status span { display: flex; gap: 5px; align-items: center; }
.tg-status svg { height: 10px; fill: currentColor; stroke: none; }
.tg-status svg:first-child { width: 15px; }
.tg-status svg:last-child { width: 22px; }
.tg-status svg rect[fill="none"] { stroke: currentColor; stroke-width: 1; fill: none; opacity: 0.5; }

/* Чат */
.tg { background: radial-gradient(120% 70% at 20% 30%, #2a1f3d 0%, transparent 60%), radial-gradient(100% 60% at 90% 80%, #1d2340 0%, transparent 60%), #0d0b12; }
.tg-head { display: flex; align-items: center; gap: 6px; padding: 4px 8px 6px; }
.tg-back, .tg-ava, .tg-circle { flex: none; display: flex; align-items: center; justify-content: center; border-radius: 50%; }
.tg-back { width: 34px; height: 30px; border-radius: 16px; background: rgba(60, 60, 67, 0.6); font-size: 22px; line-height: 1; padding-bottom: 3px; }
.tg-title { flex: 1; min-width: 0; text-align: center; display: flex; flex-direction: column; background: rgba(60, 60, 67, 0.6); border-radius: 16px; padding: 3px 8px; }
.tg-title b, .tg-title small { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tg-title b { font-size: 13px; }
.tg-title small { font-size: 10.5px; color: var(--tg-muted); }
.tg-ava { width: 32px; height: 32px; background: linear-gradient(#8f7cf6, #6c5ce7); font-weight: 800; font-size: 14px; }
.tg-msgs { flex: 1; display: flex; flex-direction: column; justify-content: flex-end; gap: 6px; padding: 6px 8px; overflow: hidden; }
.tg-date { align-self: center; background: rgba(60, 60, 67, 0.7); border-radius: 10px; padding: 1px 9px; font-size: 11px; font-weight: 700; margin-bottom: 2px; }
.tg-row { display: flex; align-items: flex-end; gap: 5px; }
.tg-bot-ava { width: 26px; height: 26px; border-radius: 50%; flex: none; }
.tg-col { display: flex; flex-direction: column; gap: 3px; min-width: 0; flex: 1; }
.tg-bubble { background: #272236; border-radius: 14px 14px 14px 5px; padding: 5px 9px 4px; display: flex; flex-direction: column; }
.tg-from { color: #b48cff; font-weight: 700; font-size: 12px; display: flex; justify-content: space-between; gap: 8px; }
.tg-from i { font-style: normal; font-weight: 400; color: #6fd17c; font-size: 11px; }
.tg-time { align-self: flex-end; font-size: 10px; color: var(--tg-muted); margin-top: -2px; }
.tg-btn-row { display: flex; gap: 3px; }
.tg-btn-row .tg-inline { flex: 1; min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tg-inline { background: rgba(58, 52, 74, 0.85); border-radius: 12px; text-align: center; padding: 6px; font-weight: 700; font-size: 12px; position: relative; }
.tg-app-ico { position: absolute; top: 4px; right: 5px; width: 7px; height: 7px; stroke-width: 1.5; }
.tg-big { font-size: 14px; }
.tg-pre { display: grid; grid-template-columns: 1fr auto; column-gap: 14px; font-family: ui-monospace, Menlo, monospace; font-size: 11px; line-height: 1.45; border-left: 3px solid #8d6bf0; background: rgba(255, 255, 255, 0.05); border-radius: 4px; padding: 4px 8px; margin: 4px 0 2px; }
.tg-pre span:nth-child(even) { text-align: right; }
.tg-pre .gap { height: 6px; }
.tg-input { display: flex; align-items: center; gap: 5px; padding: 4px 6px; }
.tg-circle { width: 30px; height: 30px; background: rgba(60, 60, 67, 0.6); }
.tg-circle svg { width: 16px; height: 16px; }
.tg-field { flex: 1; background: rgba(28, 28, 30, 0.9); border: 1px solid rgba(255, 255, 255, 0.08); border-radius: 16px; padding: 6px 12px; color: var(--tg-muted); }
.tg-keys { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 5px; background: #1c1c1e; border-radius: 18px 18px 0 0; padding: 8px 7px 18px; }
.tg-keys span { background: #3a3a3c; border-radius: 9px; padding: 7px 2px; text-align: center; font-size: 11.5px; line-height: 1.2; display: flex; align-items: center; justify-content: center; min-height: 32px; }
.tg-keys .tg-wide { grid-column: 1 / -1; }

/* Приложение внутри Telegram: цвета тёмной темы Mini App (webapp/src/styles.css) */
.app { --app-bg: #17212b; --app-card: #212d3a; --app-accent: #4fbfae; --app-muted: #8fa3b5; background: var(--app-bg); }
.tg-sheet-head { display: flex; align-items: center; gap: 6px; padding: 4px 10px 8px; }
.tg-sheet-head .tg-title { background: none; }
.tg-sheet-head .tg-title small { color: var(--app-muted); }
.tg-sheet-head .tg-circle { font-size: 13px; font-weight: 700; }
.app-body { flex: 1; display: flex; flex-direction: column; gap: 8px; padding: 0 10px; overflow: hidden; }
.app-card { background: var(--app-card); border-radius: 12px; padding: 8px 10px; }
.app-month { display: grid; grid-template-columns: auto 1fr auto auto; align-items: center; gap: 8px; }
.app-month > span:nth-child(2) { text-align: center; display: flex; flex-direction: column; }
.app-month b { font-size: 14px; }
.app-month small, .app-label, .app-sub { color: var(--app-muted); font-size: 10.5px; }
.app-arrows { color: var(--app-muted); font-size: 20px; padding: 0 2px; }
.app-arrows.dim { opacity: 0.4; }
.app-gear { width: 32px; height: 32px; border-radius: 9px; background: var(--app-card); display: flex; align-items: center; justify-content: center; }
.app-gear svg { width: 17px; height: 17px; }
.app-total { font-size: 24px; font-weight: 800; padding: 10px 12px; }
.app-seg { display: grid; grid-template-columns: repeat(3, 1fr); background: var(--app-card); border-radius: 10px; padding: 3px; text-align: center; color: var(--app-muted); font-size: 12px; }
.app-seg span { padding: 5px 0; border-radius: 8px; }
.app-seg .on { background: #2f4256; color: var(--tg-text); }
.app-label { display: block; font-weight: 700; letter-spacing: 0.04em; margin-bottom: 2px; }
.app-cat { display: grid; grid-template-columns: 1fr auto; padding: 5px 0 7px; border-bottom: 1px solid #2a3846; font-size: 12px; }
.app-cat:last-child { border-bottom: 0; }
.app-cat i { grid-column: 1 / -1; height: 4px; border-radius: 2px; margin-top: 5px; background: linear-gradient(90deg, var(--app-accent) var(--w), #2a3846 var(--w)); }
.app-fab { position: absolute; right: 12px; bottom: 58px; width: 42px; height: 42px; border-radius: 50%; background: #1f7a70; display: flex; align-items: center; justify-content: center; font-size: 26px; font-weight: 300; box-shadow: 0 4px 12px rgba(0, 0, 0, 0.4); }
.app-tabs { display: grid; grid-template-columns: repeat(3, 1fr); border-top: 1px solid #22303d; padding: 6px 0 14px; text-align: center; font-size: 10.5px; color: var(--app-muted); background: var(--app-bg); }
.app-tabs span { display: flex; flex-direction: column; align-items: center; gap: 2px; }
.app-tabs svg { width: 19px; height: 19px; }
.app-tabs .on { color: var(--app-accent); }
.app-h { font-size: 18px; font-weight: 800; margin-top: 2px; }
.app-sub { margin-top: -6px; }
.app-add { display: flex; gap: 6px; }
.app-add .app-card:first-child { flex: 1; color: var(--app-muted); }
.app-plus { color: var(--app-muted); font-size: 16px; padding: 6px 12px; }
.app-item { display: grid; grid-template-columns: auto 1fr auto; align-items: center; gap: 10px; padding: 6px 0; border-bottom: 1px solid #2a3846; }
.app-item:last-child { border-bottom: 0; }
.app-item > span:nth-child(2) { display: flex; flex-direction: column; }
.app-item small { color: var(--app-muted); font-size: 10.5px; }
.app-check { width: 16px; height: 16px; border: 2px solid var(--app-accent); border-radius: 5px; }
.app-item.done b { text-decoration: line-through; color: var(--app-muted); font-weight: 400; }
.app-item.done .app-check { background: var(--app-accent) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%2317212b' stroke-width='3.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m5 12 5 5 9-10'/%3E%3C/svg%3E") center / 12px no-repeat; }
.app-item b { font-weight: 400; }
.app-x { color: var(--app-muted); font-size: 12px; }

/* Телефон вверху страницы — чат во время добавления траты */
.phone-hero { flex: none; width: 280px; height: 610px; }
.tg-own { align-self: flex-end; background: linear-gradient(135deg, #a46bff, #7d4cf0); border-radius: 14px 14px 5px 14px; padding: 4px 9px; font-size: 14px; display: flex; gap: 8px; align-items: flex-end; }
.tg-own .tg-time { color: rgba(255, 255, 255, 0.7); margin: 0; }
.tg-link { color: #5eaefc; }
.tg-field.typed { color: var(--tg-text); display: flex; align-items: center; }
.tg-field.typed i { width: 1.5px; height: 14px; background: #5eaefc; margin-left: 1px; animation: tg-caret 1s steps(1) infinite; }
@keyframes tg-caret { 50% { opacity: 0; } }
@media (prefers-reduced-motion: reduce) { .tg-field.typed i { animation: none; } }
.tg-send { background: #3a8ef6; }

/* Приложение: карандаш, экспорт, История */
.app-label { display: flex; justify-content: space-between; align-items: center; }
.app-label svg { width: 13px; height: 13px; color: var(--app-muted); }
.app-link { text-align: center; color: var(--app-accent); font-size: 12px; padding: 8px; }
.app-title { display: flex; justify-content: space-between; align-items: center; }
.app-title svg { width: 16px; height: 16px; color: var(--app-muted); }
.app-month-plain { grid-template-columns: auto 1fr auto; }
.app-chips { display: flex; gap: 6px; }
.app-chips span { background: var(--app-card); border-radius: 14px; padding: 4px 8px 4px 10px; font-size: 11px; display: flex; align-items: center; gap: 2px; }
.app-chips svg { width: 12px; height: 12px; }
.app-list { display: flex; flex-direction: column; }
.app-day { display: flex; justify-content: space-between; color: var(--app-muted); font-size: 10.5px; font-weight: 700; letter-spacing: 0.03em; padding: 6px 22px 2px 0; }
.app-exp { display: grid; grid-template-columns: 1fr auto auto; align-items: center; gap: 6px; padding: 5px 0; border-bottom: 1px solid #2a3846; }
.app-exp > span:first-child { display: flex; flex-direction: column; min-width: 0; }
.app-exp b { font-weight: 400; }
.app-exp small { color: var(--app-muted); font-size: 10.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.app-exp svg { width: 13px; height: 13px; color: var(--app-muted); }
