/* Общий слой прототипов Анны Казанцевой. Цвет приложения задаётся токенами --a-* в index.html */
@font-face { font-family: 'Inter'; font-weight: 400 600; font-display: swap; src: url('fonts/inter-cyrillic.woff2') format('woff2');
  unicode-range: U+0301, U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116; }
@font-face { font-family: 'Inter'; font-weight: 400 600; font-display: swap; src: url('fonts/inter-latin.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 {
  --surface: #ffffff;
  --r-lg: 18px;
  --r-md: 13px;
  --r-sm: 9px;
  --r-pill: 999px;
  --ff: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Arial, sans-serif;
  --serif: Georgia, 'Times New Roman', serif;
  --danger: #b4262c;
  --danger-tint: #fbe9e9;
  --ok: #24724a;
  --ok-tint: #e3f1e8;
  --shadow: 0 1px 2px rgba(0,0,0,.05), 0 6px 18px rgba(0,0,0,.06);
  --dur: 180ms;
  --ease: cubic-bezier(.2,.7,.2,1);
  --tab-h: 64px;
}

* { box-sizing: border-box; margin: 0; padding: 0; }
html { -webkit-text-size-adjust: 100%; }
body { font-family: var(--ff); background: var(--a-page); color: var(--a-ink); -webkit-font-smoothing: antialiased;
  font-size: 15px; line-height: 1.5; min-height: 100dvh; }
button, input, textarea { font: inherit; color: inherit; }
button { cursor: pointer; border: 0; background: none; }
a { color: inherit; }
svg.i { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 1.9; stroke-linecap: round; stroke-linejoin: round; flex: none; }
:focus-visible { outline: 2.5px solid var(--a-accent); outline-offset: 2px; border-radius: 8px; }

.shell { max-width: 440px; margin: 0 auto; min-height: 100dvh; background: var(--a-bg); position: relative;
  padding-bottom: calc(var(--tab-h) + env(safe-area-inset-bottom) + 12px); }
@media (min-width: 520px) { .shell { box-shadow: 0 0 0 1px var(--a-line), 0 20px 60px rgba(0,0,0,.08); } }
.shell.no-tabs { padding-bottom: 24px; }

.demo { display: flex; align-items: center; justify-content: center; gap: 6px; font-size: 12px; color: var(--a-ink-2);
  background: var(--a-tint); padding: 6px 12px; }
.demo b { color: var(--a-ink); font-weight: 600; }

/* шапка экрана */
.top { display: flex; align-items: center; gap: 10px; padding: 16px 16px 10px; }
.top h1 { font-size: 22px; line-height: 1.2; font-weight: 600; letter-spacing: -.02em; }
.top .sub { font-size: 13px; color: var(--a-ink-2); margin-top: 2px; }
.top .grow { flex: 1; min-width: 0; }
.back { width: 40px; height: 40px; border-radius: 50%; display: flex; align-items: center; justify-content: center; color: var(--a-accent-deep);
  transition: background var(--dur) var(--ease); margin-left: -8px; }
.back:hover { background: var(--a-tint); }
.back:active { transform: scale(.94); }

.av { width: 40px; height: 40px; border-radius: 50%; background: var(--a-tint); color: var(--a-accent-deep); font-size: 13px; font-weight: 600;
  display: flex; align-items: center; justify-content: center; flex: none; }
.av.sm { width: 32px; height: 32px; font-size: 11.5px; }
.av.dk { background: var(--a-ink); color: #fff; }

.wrap { padding: 0 16px; display: flex; flex-direction: column; gap: 12px; }
.card { background: var(--surface); border-radius: var(--r-lg); padding: 14px 15px; box-shadow: var(--shadow); }
.card.dk { background: var(--a-ink); color: #fff; box-shadow: none; }
.card.tint { background: var(--a-tint); box-shadow: none; }
.card.warm { background: var(--a-warm-tint); box-shadow: none; }
.lbl { font-size: 11.5px; font-weight: 600; letter-spacing: .06em; text-transform: uppercase; color: var(--a-ink-2); }
.card.dk .lbl { color: var(--a-on-dark-2); }
.card h2 { font-size: 17px; line-height: 1.3; font-weight: 600; letter-spacing: -.01em; margin-top: 4px; }
.card p { font-size: 14.5px; color: var(--a-ink); margin-top: 6px; }
.card .meta { font-size: 13px; color: var(--a-ink-2); margin-top: 4px; }
.card.dk .meta { color: var(--a-on-dark-2); }
.row { display: flex; align-items: center; gap: 10px; }
.row .grow { flex: 1; min-width: 0; }
.serif { font-family: var(--serif); font-weight: 400; letter-spacing: -.01em; }
.muted { color: var(--a-ink-2); }

/* кнопки: 8 состояний */
.btn { text-decoration: none; display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 46px; padding: 0 18px; border-radius: 14px;
  background: var(--a-accent); color: #fff; font-weight: 600; font-size: 15px;
  transition: background var(--dur) var(--ease), transform var(--dur) var(--ease), box-shadow var(--dur) var(--ease); }
.btn:hover { background: var(--a-accent-deep); }
.btn:active { transform: scale(.98); }
.btn:disabled, .btn[aria-disabled="true"] { background: var(--a-line-soft); color: var(--a-ink-2); cursor: not-allowed; transform: none; }
.btn.loading { color: transparent; position: relative; pointer-events: none; }
.btn.loading::after { content: ""; position: absolute; width: 18px; height: 18px; border-radius: 50%; border: 2.5px solid rgba(255,255,255,.45);
  border-top-color: #fff; animation: spin .8s linear infinite; }
.btn.block { width: 100%; }
.btn.ghost { background: transparent; color: var(--a-accent-deep); box-shadow: inset 0 0 0 1.5px var(--a-line); }
.btn.ghost:hover { background: var(--a-tint); }
.card.dk .btn.ghost { color: #fff; box-shadow: inset 0 0 0 1.5px rgba(255,255,255,.28); }
.card.dk .btn.ghost:hover { background: rgba(255,255,255,.08); }
.btn.danger { background: var(--danger); }
.btn.danger:hover { background: #8f1d22; }
.btn.sm { min-height: 38px; padding: 0 14px; font-size: 14px; border-radius: 11px; }
.btns { display: flex; gap: 8px; margin-top: 12px; flex-wrap: wrap; }
.btns .btn { flex: 1; }
@keyframes spin { to { transform: rotate(360deg); } }

/* чипы-фильтры */
.chips { display: flex; gap: 8px; padding: 0 16px 4px; overflow-x: auto; scrollbar-width: none; }
.chips::-webkit-scrollbar { display: none; }
.chip-f { flex: none; min-height: 36px; padding: 0 14px; border-radius: var(--r-pill); background: var(--surface); color: var(--a-ink-2); font-size: 14px;
  box-shadow: inset 0 0 0 1px var(--a-line); transition: background var(--dur) var(--ease), color var(--dur) var(--ease); }
.chip-f:hover { color: var(--a-ink); }
.chip-f[aria-pressed="true"] { background: var(--a-ink); color: #fff; box-shadow: none; font-weight: 600; }
.tag { display: inline-flex; align-items: center; font-size: 12px; font-weight: 600; border-radius: var(--r-pill); padding: 3px 9px; white-space: nowrap;
  background: var(--a-tint); color: var(--a-accent-deep); }
.tag.ok { background: var(--ok-tint); color: var(--ok); }
.tag.warm { background: var(--a-warm-tint); color: var(--a-warm); }
.tag.mute { background: var(--a-bg); color: var(--a-ink-2); }

/* список */
.list { background: var(--surface); border-radius: var(--r-lg); box-shadow: var(--shadow); overflow: hidden; }
.li { display: flex; align-items: center; gap: 12px; padding: 13px 15px; width: 100%; text-align: left; border-bottom: 1px solid var(--a-line-soft);
  transition: background var(--dur) var(--ease); min-height: 60px; }
.li:last-child { border-bottom: 0; }
button.li:hover { background: var(--a-bg); }
button.li:active { background: var(--a-tint); }
.li .t { flex: 1; min-width: 0; }
.li .t b { display: block; font-weight: 600; font-size: 15px; }
.li .t span { display: block; font-size: 13px; color: var(--a-ink-2); margin-top: 1px; }
.li .chev { color: var(--a-ink-2); }

.play { width: 42px; height: 42px; border-radius: 50%; background: var(--a-accent); color: #fff; display: flex; align-items: center; justify-content: center; flex: none; }
.play svg { width: 16px; height: 16px; fill: currentColor; stroke: none; margin-left: 2px; }
.play.lock { background: var(--a-bg); color: var(--a-ink-2); }
.play.lock svg { fill: none; stroke: currentColor; margin: 0; }

.bar { height: 7px; border-radius: 4px; background: var(--a-line-soft); overflow: hidden; margin-top: 8px; }
.bar i { display: block; height: 100%; background: var(--a-accent); border-radius: 4px; transition: width .4s var(--ease); }
.card.dk .bar { background: rgba(255,255,255,.18); }
.card.dk .bar i { background: var(--a-on-dark-bar); }

/* поля ввода */
.field { display: flex; flex-direction: column; gap: 6px; }
.field label { font-size: 13.5px; font-weight: 600; }
.input { min-height: 48px; border-radius: 12px; padding: 12px 14px; font-size: 16px; background: var(--surface);
  box-shadow: inset 0 0 0 1.5px var(--a-line); border: 0; transition: box-shadow var(--dur) var(--ease); width: 100%; }
.input:hover { box-shadow: inset 0 0 0 1.5px var(--a-ink-2); }
.input:focus { outline: none; box-shadow: inset 0 0 0 2px var(--a-accent); }
.input[aria-invalid="true"] { box-shadow: inset 0 0 0 2px var(--danger); }
textarea.input { min-height: 104px; resize: vertical; line-height: 1.45; }
.err { font-size: 13px; color: var(--danger); display: none; }
.field.bad .err { display: block; }
.check { display: flex; gap: 10px; align-items: flex-start; font-size: 13.5px; color: var(--a-ink-2); line-height: 1.45; }
.check input { width: 20px; height: 20px; margin-top: 1px; accent-color: var(--a-accent); flex: none; }
.opts { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.opt { min-height: 48px; border-radius: 12px; padding: 10px 12px; text-align: left; background: var(--surface); box-shadow: inset 0 0 0 1.5px var(--a-line);
  font-size: 14px; transition: box-shadow var(--dur) var(--ease), background var(--dur) var(--ease); }
.opt:hover { box-shadow: inset 0 0 0 1.5px var(--a-ink-2); }
.opt[aria-pressed="true"] { box-shadow: inset 0 0 0 2px var(--a-accent); background: var(--a-tint); color: var(--a-accent-deep); font-weight: 600; }

/* лента */
.post { background: var(--surface); border-radius: var(--r-lg); box-shadow: var(--shadow); padding: 14px 15px; }
.post .ph { display: flex; align-items: center; gap: 10px; margin-bottom: 8px; }
.post .ph b { display: block; font-size: 14.5px; font-weight: 600; }
.post .ph small { display: block; font-size: 12.5px; color: var(--a-ink-2); }
.post h3 { font-size: 17px; font-weight: 600; line-height: 1.3; letter-spacing: -.01em; }
.post p { font-size: 14.5px; margin-top: 6px; }
.post .open { text-align: left; width: 100%; display: block; border-radius: 10px; }
.rx { display: flex; gap: 6px; margin-top: 10px; }
.rx button, .rx .rxa { text-decoration: none; display: inline-flex; align-items: center; gap: 6px; min-height: 36px; padding: 0 12px; border-radius: var(--r-pill); font-size: 13.5px; color: var(--a-ink-2);
  transition: background var(--dur) var(--ease), color var(--dur) var(--ease); }
.rx button:hover, .rx .rxa:hover { background: var(--a-bg); color: var(--a-ink); }
.rx button svg, .rx .rxa svg { width: 18px; height: 18px; }
.rx button[aria-pressed="true"] { color: var(--a-warm); }
.rx button[aria-pressed="true"] svg { fill: currentColor; }

.cmt { display: flex; gap: 10px; padding: 10px 0; border-top: 1px solid var(--a-line-soft); }
.cmt b { font-size: 13.5px; font-weight: 600; }
.cmt p { font-size: 14px; margin-top: 1px; }
.cmt.anna b { color: var(--a-accent-deep); }

/* чат */
.chat { display: flex; flex-direction: column; gap: 8px; padding: 4px 16px 0; }
.msg { max-width: 86%; padding: 9px 12px; border-radius: 16px; font-size: 14.5px; line-height: 1.45; background: var(--surface); box-shadow: var(--shadow); white-space: pre-line; }
.msg.me { align-self: flex-end; background: var(--a-tint); box-shadow: none; border-bottom-right-radius: 5px; }
.msg.in { align-self: flex-start; border-bottom-left-radius: 5px; }
.msg time { display: block; font-size: 11.5px; color: var(--a-ink-2); margin-top: 3px; text-align: right; }
.msg .who { font-size: 12.5px; font-weight: 600; color: var(--a-accent-deep); display: block; margin-bottom: 2px; }
.msg.sos { background: var(--danger-tint); box-shadow: none; }
.typing { align-self: flex-start; display: flex; gap: 4px; padding: 12px 14px; background: var(--surface); border-radius: 16px; box-shadow: var(--shadow); }
.typing i { width: 7px; height: 7px; border-radius: 50%; background: var(--a-ink-2); animation: blink 1.2s infinite; }
.typing i:nth-child(2) { animation-delay: .2s; } .typing i:nth-child(3) { animation-delay: .4s; }
@keyframes blink { 0%, 80%, 100% { opacity: .25; } 40% { opacity: 1; } }
.quick { display: flex; gap: 8px; flex-wrap: wrap; padding: 4px 16px 0; }
.quick button { min-height: 38px; padding: 0 14px; border-radius: var(--r-pill); background: var(--surface); box-shadow: inset 0 0 0 1.5px var(--a-line);
  color: var(--a-accent-deep); font-weight: 600; font-size: 14px; transition: background var(--dur) var(--ease); }
.quick button:hover { background: var(--a-tint); }
.composer { position: fixed; left: 50%; transform: translateX(-50%); width: min(440px, 100%); bottom: calc(var(--tab-h) + env(safe-area-inset-bottom));
  background: var(--a-bg); padding: 8px 12px; display: flex; gap: 8px; border-top: 1px solid var(--a-line-soft); z-index: 5; }
.composer .input { min-height: 44px; border-radius: 22px; }
.send { width: 44px; height: 44px; border-radius: 50%; background: var(--a-accent); color: #fff; display: flex; align-items: center; justify-content: center; flex: none;
  transition: background var(--dur) var(--ease); }
.send:hover { background: var(--a-accent-deep); }
.send:disabled { background: var(--a-line); color: var(--a-ink-2); cursor: not-allowed; }
.chat-pad { height: 72px; }

/* нижние вкладки */
.tabs { position: fixed; left: 50%; transform: translateX(-50%); bottom: 0; width: min(440px, 100%); height: calc(var(--tab-h) + env(safe-area-inset-bottom));
  padding-bottom: env(safe-area-inset-bottom); background: var(--surface); border-top: 1px solid var(--a-line-soft); display: grid; grid-template-columns: repeat(5, 1fr); z-index: 6; }
.tabs a { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px; font-size: 11.5px; color: var(--a-ink-2); text-decoration: none;
  position: relative; transition: color var(--dur) var(--ease); }
.tabs a:hover { color: var(--a-ink); }
.tabs a[aria-current="page"] { color: var(--a-accent-deep); font-weight: 600; }
.tabs a .dot { position: absolute; top: 9px; left: calc(50% + 6px); width: 8px; height: 8px; border-radius: 50%; background: var(--a-warm); box-shadow: 0 0 0 2px var(--surface); }

/* всплывающее уведомление */
.toast { position: fixed; left: 50%; top: 14px; transform: translate(-50%, -140%); width: min(408px, calc(100% - 24px)); background: var(--a-ink); color: #fff;
  border-radius: 14px; padding: 12px 14px; font-size: 14px; z-index: 20; transition: transform .3s var(--ease), visibility .3s; box-shadow: 0 10px 30px rgba(0,0,0,.2); visibility: hidden; }
.toast.on { transform: translate(-50%, 0); visibility: visible; }

/* приветствие */
.hello { min-height: 100dvh; display: flex; flex-direction: column; padding: 24px 22px 28px; }
.hello .logo { width: 72px; height: 72px; border-radius: 20px; background: var(--a-accent); color: #fff; display: flex; align-items: center; justify-content: center; }
.hello .logo svg { width: 34px; height: 34px; }
.hello h1 { font-family: var(--serif); font-weight: 400; font-size: 34px; line-height: 1.12; letter-spacing: -.01em; margin-top: 26px; }
.hello .lead { font-size: 16px; color: var(--a-ink-2); margin-top: 12px; }
.hello .form { margin-top: auto; display: flex; flex-direction: column; gap: 14px; padding-top: 28px; }

.empty { text-align: center; color: var(--a-ink-2); font-size: 14px; padding: 18px; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

@media (prefers-reduced-motion: reduce) { *, *::before, *::after { animation: none !important; transition: none !important; } }
