:root {
  --bg: #eef4fa;
  --card: #ffffff;
  --text: #15283b;
  --muted: #5b6f84;
  --line: #d9e5f0;
  --accent: #1b65a3;
  --accent-ink: #ffffff;
  --accent-soft: #deebf7;
  --head: linear-gradient(90deg, #18629a, #0f3d63);
  --ok: #2f8f5b;
  --danger: #c4413a;
  --radius: 14px;
  --shadow: 0 1px 3px rgba(20, 50, 90, .08), 0 4px 14px rgba(20, 50, 90, .07);
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0d1826; --card: #152437; --text: #e6eef7; --muted: #98abc0; --line: #243750;
    --accent: #5ba7e6; --accent-ink: #0d1826; --accent-soft: #1a3350; --shadow: none;
    --head: linear-gradient(90deg, #134e7c, #0b2c48);
    color-scheme: dark;
  }
}
* { box-sizing: border-box; }
html, body { margin: 0; }
body {
  background: var(--bg); color: var(--text);
  font: 16px/1.45 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  padding-bottom: env(safe-area-inset-bottom);
}
a { color: var(--accent); }
img { max-width: 100%; display: block; }
h1 { font-size: 1.5rem; margin: .2rem 0 .8rem; line-height: 1.2; }
h2 { font-size: 1.15rem; margin: 1.4rem 0 .5rem; }
p { margin: .4rem 0; }
.muted { color: var(--muted); }
.pre { white-space: pre-line; }

.top {
  position: sticky; top: 0; z-index: 10; display: flex; align-items: center; justify-content: space-between;
  padding: calc(8px + env(safe-area-inset-top)) 16px 8px; background: var(--head); color: #fff;
}
.brand { display: flex; align-items: center; gap: 10px; color: #fff; text-decoration: none; font-weight: 700; font-size: 1.1rem; }
.icon-btn { background: none; border: 0; font-size: 1.3rem; cursor: pointer; padding: 6px; border-radius: 10px; }
.icon-btn:hover { background: rgba(255, 255, 255, .15); }
.top { gap: 8px; flex-wrap: wrap; padding-bottom: 0; }
.back-btn { color: #fff; font-size: 1.5rem; line-height: 1; padding: 4px 10px 6px; margin-left: -8px; }
.page-title { display: none; flex: 1; min-width: 0; font-weight: 700; font-size: 1.1rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
body.sub .brand { display: none; }
body.sub .page-title { display: block; }
.brand { flex: 1; }
#bell { color: #fff; }
.desk-only { display: none; }

main { max-width: 860px; margin: 0 auto; padding: 16px; outline: none; }

/* mobile: icon menu is the second row of the header */
.tabs {
  order: 10; flex: 1 0 100%; display: flex; justify-content: space-around; margin: 6px -12px 0; padding: 0 0 6px;
}
.tabs a {
  flex: 1; display: flex; flex-direction: column; align-items: center; gap: 1px; padding: 4px 0;
  min-width: 0; color: rgba(255, 255, 255, .8); text-decoration: none; font-size: .7rem; border-radius: 10px; white-space: nowrap;
}
/* line icons from the sprite in index.html */
.ic { width: 24px; height: 24px; flex: none; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.tabs a .ic { width: 48px; height: 30px; padding: 4px 12px; border-radius: 999px; transition: background .2s, color .2s, transform .15s; }
.tabs a:hover .ic { background: rgba(255, 255, 255, .14); }
.tabs a:active .ic { transform: scale(.92); }
.tabs a.on { color: #fff; font-weight: 700; }
.tabs a.on .ic { background: #fff; color: #18629a; box-shadow: 0 2px 8px rgba(0, 0, 0, .18); }
.tabs a.staff-tab { display: none; }  /* desktop header only, for accounts with panel rights; phones use the menu */
.staff-box { border-color: var(--accent); background: var(--accent-soft); }

/* news / events switch */
.seg { display: flex; gap: 4px; background: var(--accent-soft); padding: 4px; border-radius: 999px; margin: 0 0 16px; max-width: 420px; }
.seg a { flex: 1; text-align: center; padding: 8px 12px; border-radius: 999px; text-decoration: none; color: var(--muted); font-weight: 600; }
.seg a.on { background: var(--card); color: var(--accent); box-shadow: 0 1px 4px rgba(20, 50, 90, .12); }

/* home quick actions: bar under the banner, same width */
.quick { position: relative; display: grid; grid-template-columns: repeat(4, 1fr); margin: 0 0 16px; overflow: hidden;
  background: var(--card); border: 1px solid var(--line); border-radius: 18px; box-shadow: 0 4px 16px rgba(20, 50, 90, .1);
  animation: m-rise .5s cubic-bezier(.2, .9, .3, 1.2) both; }
.quick::after { content: ''; position: absolute; inset: 0; pointer-events: none; transform: translateX(-100%);
  background: linear-gradient(100deg, transparent 30%, rgba(255, 255, 255, .55) 50%, transparent 70%); animation: q-shine 1.4s .7s ease-in-out both; }
.quick a { position: relative; overflow: hidden; display: flex; flex-direction: column; align-items: center; gap: 6px; padding: 14px 4px 12px; text-align: center;
  border-left: 1px solid var(--line); text-decoration: none; color: var(--text); font-size: .8rem; font-weight: 600; line-height: 1.2;
  -webkit-tap-highlight-color: transparent; transition: background .2s; }
.quick a:first-child { border-left: 0; }
.quick a .ic { width: 48px; height: 48px; padding: 12px; border-radius: 16px; color: #fff;
  background: linear-gradient(145deg, hsl(var(--h) 75% 62%), hsl(var(--h) 65% 42%)); box-shadow: 0 6px 14px hsl(var(--h) 60% 45% / .35);
  animation: q-pop .6s cubic-bezier(.2, .9, .3, 1.4) both; animation-delay: calc(.15s + var(--i) * 80ms); transition: transform .35s cubic-bezier(.2, .9, .3, 1.2); }
.quick a span { animation: m-rise .5s ease both; animation-delay: calc(.25s + var(--i) * 80ms); }
.quick a:hover { background: hsl(var(--h) 70% 50% / .08); }
.quick a:hover .ic { transform: translateY(-3px) rotate(-8deg) scale(1.08); }
.quick a:active .ic { transform: scale(.9); }
@keyframes q-pop { from { opacity: 0; transform: scale(.3) rotate(-25deg); } to { opacity: 1; transform: none; } }
@keyframes q-shine { to { transform: translateX(100%); } }

/* header: slowly flowing gradient, sliding pill under the active tab */
.top { background: linear-gradient(110deg, #1f74b5, #18629a 35%, #0f3d63 70%, #18629a); background-size: 220% 100%; animation: h-flow 14s ease-in-out infinite alternate; }
@media (prefers-color-scheme: dark) { .quick::after { opacity: .2; } .top { background-image: linear-gradient(110deg, #17598d, #134e7c 35%, #0b2c48 70%, #134e7c); } }
@keyframes h-flow { from { background-position: 0% 0; } to { background-position: 100% 0; } }
.brand img { transition: transform .5s cubic-bezier(.2, .9, .3, 1.4); }
.brand:hover img { transform: rotate(-12deg) scale(1.08); }
.tabs { position: relative; }
.tabs a { position: relative; z-index: 1; overflow: hidden; -webkit-tap-highlight-color: transparent; transition: color .25s; }
.tab-pill { position: absolute; left: 0; top: 0; z-index: 0; border-radius: 999px; background: #fff; box-shadow: 0 3px 10px rgba(0, 0, 0, .2);
  pointer-events: none; transition: transform .45s cubic-bezier(.3, 1.3, .4, 1), width .45s cubic-bezier(.3, 1.3, .4, 1), height .3s, opacity .2s; }
.tab-pill.still { transition: none; }
.tabs a.on .ic { background: transparent; box-shadow: none; }
.tabs a.pop .ic { animation: t-bounce .5s cubic-bezier(.3, 1.5, .5, 1); }
.tabs a .m-ripple { background: #fff; opacity: .3; }
@keyframes t-bounce { 0% { transform: scale(1); } 40% { transform: scale(1.18) translateY(-2px); } 100% { transform: scale(1); } }

/* menu */
.m-wrap { --ease: cubic-bezier(.2, .9, .3, 1.2); padding-bottom: 24px; }
.m-hero, .m-quick a, .m-item { position: relative; overflow: hidden; -webkit-tap-highlight-color: transparent; }
.m-hero { display: flex; align-items: center; gap: 14px; margin: 6px 0 14px; padding: 18px 16px; border-radius: 22px;
  background: linear-gradient(125deg, #2a86cf, #18629a 45%, #0f3d63); background-size: 200% 200%; color: #fff; text-decoration: none;
  box-shadow: 0 10px 28px rgba(16, 70, 120, .35); animation: m-pop .55s var(--ease) both, m-flow 9s ease-in-out infinite alternate; }
.m-hero:active { transform: scale(.985); }
.m-ava { position: relative; flex: none; width: 60px; height: 60px; border-radius: 50%; background: #fff; display: grid; place-items: center; }
.m-ava::after { content: ''; position: absolute; inset: -5px; border-radius: 50%; border: 2px solid rgba(255, 255, 255, .55); animation: m-pulse 2.6s ease-out infinite; }
.m-ava img { width: 56px; height: 56px; border-radius: 50%; animation: m-bob 4s ease-in-out infinite; }
.m-hello { flex: 1; min-width: 0; display: flex; flex-direction: column; z-index: 1; }
.m-hello small { opacity: .8; font-size: .85rem; }
.m-hello b { font-size: 1.3rem; line-height: 1.2; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.m-hello em { font-style: normal; opacity: .85; font-size: .85rem; }
.m-hero .m-go { color: #fff; z-index: 1; }
.m-paws { position: absolute; inset: 0; pointer-events: none; }
.m-paw { position: absolute; left: var(--x); bottom: -30px; color: #fff; opacity: 0; transform: scale(var(--s)); animation: m-float 9s linear var(--d) infinite; }
.m-paw .ic { width: 22px; height: 22px; }

.m-quick { display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; margin-bottom: 6px; }
.m-quick a { display: flex; flex-direction: column; align-items: center; gap: 6px; padding: 12px 4px 10px; border-radius: 18px;
  background: var(--card); border: 1px solid var(--line); color: var(--text); text-decoration: none; font-size: .82rem; font-weight: 600;
  animation: m-rise .5s var(--ease) both; animation-delay: calc(.08s + var(--i) * 55ms); transition: transform .2s var(--ease), box-shadow .2s; }
.m-quick a span { width: 46px; height: 46px; border-radius: 15px; display: grid; place-items: center; color: #fff;
  background: linear-gradient(145deg, hsl(var(--h) 75% 62%), hsl(var(--h) 65% 42%)); box-shadow: 0 6px 14px hsl(var(--h) 60% 45% / .35);
  transition: transform .35s var(--ease); }
.m-quick .ic { width: 24px; height: 24px; }
.m-quick a:hover { transform: translateY(-3px); box-shadow: var(--shadow); }
.m-quick a:hover span { transform: rotate(-8deg) scale(1.08); }
.m-quick a:active { transform: scale(.95); }

.m-group { animation: m-rise .5s var(--ease) both; animation-delay: calc(.1s + var(--i) * 60ms); }
.m-group h2 { display: flex; align-items: center; gap: 8px; font-size: .78rem; text-transform: uppercase; letter-spacing: .07em; color: var(--muted); margin: 20px 6px 8px; }
.m-group h2::before { content: ''; width: 8px; height: 8px; border-radius: 50%; background: hsl(var(--h) 65% 52%); box-shadow: 0 0 0 4px hsl(var(--h) 65% 52% / .18); }
.m-list { background: var(--card); border: 1px solid var(--line); border-radius: 18px; overflow: hidden; box-shadow: var(--shadow); }
.m-item { display: flex; align-items: center; gap: 12px; width: 100%; padding: 12px 14px; border: 0; border-top: 1px solid var(--line);
  background: none; color: var(--text); text-decoration: none; text-align: left; font: inherit; cursor: pointer; transition: background .2s; }
.m-list > :first-child { border-top: 0; }
.m-item:hover { background: hsl(var(--h) 70% 50% / .08); }
.m-item:active { background: hsl(var(--h) 70% 50% / .14); }
.m-ic { flex: none; width: 42px; height: 42px; border-radius: 13px; display: flex; align-items: center; justify-content: center; color: #fff;
  background: linear-gradient(145deg, hsl(var(--h) 75% 62%), hsl(var(--h) 65% 42%)); box-shadow: 0 4px 10px hsl(var(--h) 60% 45% / .3);
  transition: transform .35s var(--ease); }
.m-ic .ic { width: 22px; height: 22px; }
.m-item:hover .m-ic { transform: rotate(-8deg) scale(1.1); }
.m-item:hover .m-ic .ic { animation: m-wiggle .5s ease; }
.m-tx { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.m-tx small { color: var(--muted); font-size: .85rem; }
.m-go { color: var(--muted); font-size: 1.4rem; transition: transform .25s var(--ease), color .2s; }
.m-item:hover .m-go { transform: translateX(4px); color: hsl(var(--h) 65% 50%); }
.m-ripple { position: absolute; border-radius: 50%; background: currentColor; opacity: .14; transform: scale(0); pointer-events: none; animation: m-ripple .6s ease-out; }
.m-hero .m-ripple { background: #fff; opacity: .25; }

@keyframes m-rise { from { opacity: 0; transform: translateY(18px) scale(.97); } to { opacity: 1; transform: none; } }
@keyframes m-pop { from { opacity: 0; transform: scale(.92) translateY(-8px); } to { opacity: 1; transform: none; } }
@keyframes m-flow { from { background-position: 0% 30%; } to { background-position: 100% 70%; } }
@keyframes m-pulse { 0% { transform: scale(1); opacity: .8; } 100% { transform: scale(1.35); opacity: 0; } }
@keyframes m-bob { 0%, 100% { transform: translateY(0) rotate(0); } 50% { transform: translateY(-3px) rotate(-4deg); } }
@keyframes m-float { 0% { opacity: 0; transform: translateY(0) rotate(-15deg) scale(var(--s)); } 15% { opacity: .22; }
  80% { opacity: .15; } 100% { opacity: 0; transform: translateY(-150px) rotate(20deg) scale(var(--s)); } }
@keyframes m-wiggle { 0%, 100% { transform: rotate(0); } 25% { transform: rotate(-14deg); } 60% { transform: rotate(10deg); } }
@keyframes m-ripple { to { transform: scale(1); opacity: 0; } }
@media (min-width: 900px) {
  .m-wrap { max-width: 760px; margin: 0 auto; }
}
@media (prefers-reduced-motion: reduce) {
  .top, .quick, .quick *, .quick::after, .tabs a .ic { animation: none !important; }
  .quick::after { display: none; }
  .tab-pill { transition: none; }
  .m-wrap *, .m-wrap *::after { animation: none !important; transition: none !important; }
  .m-paw { display: none; }
}

/* how to adopt */
.steps { list-style: none; padding: 0; margin: 0 0 20px; display: flex; flex-direction: column; gap: 4px; }
.steps li { display: flex; gap: 14px; padding: 12px 0; }
.st-n { flex: none; width: 36px; height: 36px; border-radius: 50%; background: var(--accent); color: #fff; font-weight: 700; display: flex; align-items: center; justify-content: center; }
.steps p { margin: 2px 0 0; }
.inst { padding: 0; margin-bottom: 10px; }
.inst summary { display: flex; align-items: center; gap: 10px; padding: 14px 16px; font-weight: 700; cursor: pointer; list-style: none; }
.inst summary::-webkit-details-marker { display: none; }
.inst summary::after { content: '›'; margin-left: auto; color: var(--muted); font-size: 1.4rem; transition: transform .15s; }
.inst[open] summary::after { transform: rotate(90deg); }
.inst summary span { font-size: 1.4rem; }
.inst .steps { padding: 0 16px 8px; margin: 0; }
.inst .steps li { padding: 8px 0; align-items: flex-start; }
.ok-box { border-color: #2e9d6a; }
.tips { margin: 0; padding-left: 20px; }
.tips li { margin: 4px 0; }
/* login */
.auth { max-width: 480px; }
.step-n { margin: 0 0 8px; font-size: .8rem; font-weight: 700; color: var(--accent); text-transform: uppercase; letter-spacing: .04em; }
.code-input { font-size: 1.6rem; letter-spacing: .4em; text-align: center; font-variant-numeric: tabular-nums; }
.auth-links { display: flex; justify-content: space-between; gap: 12px; margin: 10px 0 0; }
.linkish { background: none; border: 0; padding: 0; color: var(--accent); font: inherit; font-size: .9rem; cursor: pointer; }
.linkish:disabled { color: var(--muted); cursor: default; }
.chat-login { align-items: center; text-align: center; padding-bottom: 4px; }
.chat-login p { margin: 0 0 4px; }

/* community chat */
.chat { display: flex; flex-direction: column; min-height: 320px; }
.chat-top h1 { margin: 0; }
.chat-top p { margin: 2px 0 8px; }
.app-dl { display: flex; align-items: center; gap: 14px; }
.app-dl img { border-radius: 18px; flex: none; }
/* Photos and videos: no long-press save menu or drag (see app.js). Text stays selectable; only controls are not,
   so a tap on a tab or button doesn't select its label. */
body:not(.admin) img, body:not(.admin) video { -webkit-touch-callout: none; -webkit-user-drag: none; }
.tabs, .btn, .act, .seg, .m-item, .m-quick, .quick, .adm-nav { -webkit-user-select: none; user-select: none; }
.emoji-panel[hidden] { display: none; }
/* «Назначить из зарегистрированных»: the global full-width select squeezed the name column */
.adm-row.pick-row { flex-wrap: wrap; }
.adm-row.pick-row .grow { flex: 1 1 220px; min-width: 220px; overflow-wrap: anywhere; }
.pick-act { display: flex; gap: 8px; align-items: center; flex: none; margin-left: auto; }
.pick-act select { width: auto; min-height: 36px; padding: 6px 10px; }
.adm-row a.grow { text-decoration: none; color: inherit; }
.partners { display: grid; gap: 12px; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); margin-bottom: 12px; }
.partner { margin: 0; }
.partner-head { display: flex; gap: 12px; align-items: center; margin-bottom: 8px; }
.partner-head img, .partner-ph { width: 64px; height: 64px; border-radius: 14px; object-fit: contain; background: #fff; flex: none; border: 1px solid var(--line); }
.partner-ph { display: grid; place-items: center; color: var(--accent); background: var(--accent-soft); }
.partner-ph .ic { width: 30px; height: 30px; }
.partner-head h2 { margin: 0; font-size: 1.1rem; }
.partner-perk { background: var(--accent-soft); color: var(--accent); border-radius: 10px; padding: 6px 10px; font-weight: 600; font-size: .9rem; margin: 6px 0; }
.partner-strip { display: flex; gap: 10px; overflow-x: auto; padding: 2px 0 10px; scrollbar-width: thin; }
.partner-chip { flex: none; height: 64px; min-width: 64px; max-width: 160px; padding: 6px 10px; border-radius: 14px; background: #fff;
  border: 1px solid var(--line); display: grid; place-items: center; text-decoration: none; color: #1d2939; font-weight: 600; font-size: .85rem; text-align: center; }
.partner-chip img { max-height: 52px; max-width: 140px; object-fit: contain; }
.partner-logo-big { display: block; max-width: 200px; max-height: 200px; background: #fff; border-radius: 14px; border: 1px solid var(--line); padding: 8px; margin-bottom: 8px; }
.tip { position: fixed; z-index: 1000; max-width: 280px; padding: 6px 10px; border-radius: 8px; background: #1d2939; color: #fff;
  font-size: .8rem; line-height: 1.35; box-shadow: 0 4px 14px #0004; pointer-events: none; }
.tip[hidden] { display: none; }
.sbp-box { border-color: var(--accent); }
.draft-box { border-color: #d9a400; background: #fff7d6; }
@media (prefers-color-scheme: dark) { .draft-box { border-color: #8a6d00; background: #2e2708; } }
.sbp-phone { font-size: 1.6rem; font-weight: 700; letter-spacing: .02em; margin: 4px 0 8px; }
.app-promo { border-color: var(--accent); background: var(--accent-soft); }
.emoji-panel { border: 1px solid var(--line); border-radius: 14px; background: var(--card); overflow: hidden; }
.emoji-tabs { display: flex; overflow-x: auto; border-bottom: 1px solid var(--line); scrollbar-width: none; }
.emoji-tabs button { flex: none; display: flex; align-items: center; gap: 4px; border: 0; background: none; padding: 6px 10px; font-size: .75rem; color: inherit; cursor: pointer; border-bottom: 2px solid transparent; }
.emoji-tabs button[aria-selected=true] { border-bottom-color: var(--accent); color: var(--accent); font-weight: 600; }
.emoji-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(40px, 1fr)); max-height: 200px; overflow-y: auto; padding: 4px; }
.emoji-grid button { border: 0; background: none; font-size: 1.5rem; height: 42px; cursor: pointer; border-radius: 10px; }
.emoji-grid button:hover { background: var(--accent-soft); }
.sr-photos { display: flex; gap: 6px; overflow-x: auto; margin: 8px 0; }
.sr-photos img { width: 96px; height: 96px; object-fit: cover; border-radius: 10px; }
fieldset { border: 1px solid var(--line); border-radius: var(--radius); padding: 12px 14px 4px; margin: 0 0 14px; background: var(--card); }
legend { font-weight: 700; padding: 0 6px; }
.cta-row { display: flex; gap: 10px; flex-wrap: wrap; }

.filters { display: flex; gap: 8px; overflow-x: auto; padding-bottom: 6px; margin-bottom: 8px; scrollbar-width: none; }
.filters select {
  flex: none; width: auto; padding: 8px 10px; border-radius: 999px; border: 1px solid var(--line); background: var(--card); color: var(--text); font-size: .9rem;
}
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); gap: 12px; }
.card {
  background: var(--card); border-radius: var(--radius); box-shadow: var(--shadow); overflow: hidden;
  color: var(--text); text-decoration: none; display: block; border: 1px solid var(--line);
}
.card .ph { aspect-ratio: 1; background: var(--accent-soft) center/cover no-repeat; display: flex; align-items: center; justify-content: center; font-size: 3rem; }
.card .ph img { width: 100%; height: 100%; object-fit: cover; }
.card .in { padding: 10px 12px 12px; }
.card .t { font-weight: 700; font-size: 1.05rem; }
.card .s { color: var(--muted); font-size: .85rem; }

.badge { display: inline-block; padding: 2px 9px; border-radius: 999px; font-size: .75rem; font-weight: 600; background: var(--accent-soft); color: var(--accent); }
.badge.foster { background: #e0f2f0; color: #1d7a70; }
.badge.home { background: #dff3e7; color: var(--ok); }
.badge.urgent { background: #fbe1df; color: var(--danger); }
.badge.vet { background: #e0f2f0; color: #1d7a70; }
@media (prefers-color-scheme: dark) {
  .badge.vet { background: #173a37; color: #7fd3c8; }
  .badge.foster { background: #173a37; color: #7fd3c8; }
  .badge.home { background: #1d3427; color: #7fd1a1; }
  .badge.urgent { background: #3f1f1d; color: #f08b84; }
}

.gallery { display: flex; gap: 8px; overflow-x: auto; scroll-snap-type: x mandatory; border-radius: var(--radius); margin: 0 -16px 12px; padding: 0 16px; scrollbar-width: none; }
.gallery img, .gallery video { flex: none; width: min(88%, 520px); aspect-ratio: 1; object-fit: cover; border-radius: var(--radius); scroll-snap-align: center; background: var(--accent-soft); }
.gallery video { object-fit: contain; background: #000; }
.gallery .gal-fit { flex: none; width: min(88%, 520px); aspect-ratio: 1; border-radius: var(--radius); scroll-snap-align: center; }
.gallery .gal-fit img { display: block; width: 100%; height: 100%; border-radius: 0; animation: none; background: none; }
/* Whole photo, never cropped: the frame keeps its shape, the empty part shows the same photo blurred */
.fit { position: relative; overflow: hidden; isolation: isolate; }
.fit::before { content: ""; position: absolute; inset: -30px; z-index: -1; background: var(--bg) center / cover no-repeat;
  filter: blur(22px) brightness(.75) saturate(1.1); }
.fit img { object-fit: contain !important; }
.facts { display: flex; flex-wrap: wrap; gap: 6px; margin: 6px 0 10px; }
.facts span { background: var(--card); border: 1px solid var(--line); border-radius: 999px; padding: 3px 10px; font-size: .85rem; }

.list { display: flex; flex-direction: column; gap: 12px; }
.post { display: flex; gap: 12px; padding: 12px; }
.post .ph { width: 84px; height: 84px; flex: none; border-radius: 10px; aspect-ratio: auto; font-size: 2rem; }
.post .t { margin-bottom: 2px; }
.wall-list { display: flex; flex-direction: column; gap: 16px; }
.wall { padding: 0; }
.wall .acts { border-top: 1px solid var(--line); margin-top: 12px; padding: 6px 10px; }
.wall-ph + .acts, a:has(.wall-ph) + .acts { margin-top: 0; }
.post-acts { padding: 8px 0; }
.wall a { color: inherit; text-decoration: none; }
.wall-head { display: flex; align-items: center; gap: 10px; padding: 14px 16px 8px; }
.wall-head img { width: 40px; height: 40px; border-radius: 50%; }
.wall-head div { flex: 1; display: flex; flex-direction: column; line-height: 1.25; }
.wall-head span { font-size: .85rem; }
.wall-body { display: block; padding: 0 16px; }
.wall-body .t { margin-bottom: 4px; }
.wall-body p { margin: 0; }
.clamp { display: -webkit-box; -webkit-line-clamp: 6; -webkit-box-orient: vertical; overflow: hidden; }
a.wall-more { display: inline-block; padding: 4px 16px 0; color: var(--accent); font-weight: 600; font-size: .95rem; }
.wall-ph { display: block; width: 100%; height: auto; max-height: 80vh; object-fit: contain; }  /* whole photo, no crop */
/* Behind a photo that doesn't fill the width: the same photo blurred (like VK / Instagram) instead of bare bars */
.ph-fit { position: relative; display: block; overflow: hidden; isolation: isolate; background: var(--accent-soft); margin-top: 12px; }
.ph-fit::before { content: ""; position: absolute; inset: -40px; z-index: -1; background: var(--bg) center / cover no-repeat;
  filter: blur(28px) brightness(.75) saturate(1.1); }
.ph-fit .wall-ph, .ph-fit .cover { position: relative; margin: 0; background: none; border-radius: 0; }
.cover-fit { border-radius: var(--radius); margin: 0 0 12px; }
.post .s { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.cover { display: block; border-radius: var(--radius); margin-bottom: 12px; width: 100%; height: auto; max-height: 85vh; object-fit: contain; }

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px; padding: 12px 18px; border-radius: 12px;
  border: 0; background: var(--accent); color: var(--accent-ink); font: inherit; font-weight: 600; cursor: pointer; text-decoration: none;
}
.btn.block { width: 100%; }
.btn.ghost { background: var(--accent-soft); color: var(--accent); }
.btn.danger { background: var(--danger); color: #fff; }
.btn.small { padding: 7px 12px; font-size: .9rem; border-radius: 10px; }
.btn:disabled { opacity: .55; cursor: default; }
.sticky-cta { position: sticky; bottom: calc(12px + env(safe-area-inset-bottom)); margin-top: 16px; }

form .f { margin-bottom: 12px; }
label { display: block; font-weight: 600; font-size: .9rem; margin-bottom: 4px; }
input, textarea, select {
  width: 100%; padding: 11px 12px; border-radius: 10px; border: 1px solid var(--line); background: var(--card);
  color: var(--text); font: inherit;
}
textarea { min-height: 84px; resize: vertical; }
input:focus, textarea:focus, select:focus { outline: 2px solid var(--accent); outline-offset: -1px; border-color: transparent; }
.check { display: flex; gap: 10px; align-items: flex-start; font-weight: 400; }
.check input { width: 20px; height: 20px; flex: none; margin-top: 2px; }
.hp { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }
.row2 { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }

.box { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 14px 16px; margin-bottom: 12px; }
.qr { width: 100%; max-width: 320px; border-radius: 12px; background: #fff; padding: 8px; margin: 8px 0; }
.empty { text-align: center; color: var(--muted); padding: 40px 10px; }
.empty b { display: block; font-size: 2.5rem; margin-bottom: 6px; }
.spinner { text-align: center; padding: 40px; color: var(--muted); }

#toast {
  position: fixed; left: 50%; bottom: calc(24px + env(safe-area-inset-bottom)); transform: translateX(-50%) translateY(20px);
  background: var(--text); color: var(--bg); padding: 10px 16px; border-radius: 10px; opacity: 0; pointer-events: none;
  transition: .2s; max-width: calc(100% - 32px); z-index: 50; font-size: .95rem;
}
#toast.on { opacity: 1; transform: translateX(-50%) translateY(0); }

/* admin */
.adm-nav-wrap { position: relative; margin-bottom: 14px; }
.adm-nav { display: flex; gap: 6px; overflow-x: auto; scrollbar-width: none; scroll-behavior: smooth; }
.adm-nav::-webkit-scrollbar { display: none; }
.adm-nav-arrow { position: absolute; top: 50%; transform: translateY(-50%); z-index: 1; width: 34px; height: 34px; border-radius: 50%;
  border: 1px solid var(--line); background: var(--card); color: var(--accent); font-size: 1.4rem; line-height: 1; cursor: pointer;
  box-shadow: 0 2px 8px #0003; display: grid; place-items: center; padding: 0 0 3px; }
.adm-nav-arrow[hidden] { display: none; }
.adm-nav-arrow:disabled { opacity: .35; cursor: default; box-shadow: none; }
.adm-nav-wrap.arrows .adm-nav { padding: 0 34px; scroll-padding: 0 34px; }  /* arrows don't cover the first and last item */
.adm-nav-arrow.left { left: 0; }
.adm-nav-arrow.right { right: 0; }
.adm-nav a { flex: none; padding: 7px 12px; border-radius: 999px; background: var(--card); border: 1px solid var(--line); color: var(--text); text-decoration: none; font-size: .9rem; }
.adm-nav a.on { background: var(--accent); color: var(--accent-ink); border-color: var(--accent); }
.adm-row { display: flex; align-items: center; gap: 12px; padding: 10px 12px; }
.adm-row img, .adm-row .ph { width: 52px; height: 52px; border-radius: 10px; object-fit: cover; flex: none; font-size: 1.5rem; aspect-ratio: auto; }
.adm-row .grow { flex: 1; min-width: 0; }
.adm-photos { display: grid; grid-template-columns: repeat(auto-fill, minmax(96px, 1fr)); gap: 8px; margin: 8px 0; }
.adm-photos div { position: relative; }
.adm-photos .vid { position: absolute; top: 6px; left: 6px; z-index: 1; background: #000a; color: #fff; border-radius: 999px; padding: 1px 8px; font-size: .8rem; }
.adm-photos .ph-video { aspect-ratio: 1; border-radius: 10px; background: var(--accent-soft); display: grid; place-items: center; font-size: 2rem; }
.adm-photos img { aspect-ratio: 1; object-fit: cover; border-radius: 10px; width: 100%; }
.adm-photos .acts { display: flex; gap: 4px; margin-top: 4px; }
.adm-photos .acts button { flex: 1; font-size: .75rem; padding: 4px; border-radius: 8px; border: 1px solid var(--line); background: var(--card); color: var(--text); cursor: pointer; }
.toolbar { display: flex; gap: 8px; align-items: center; justify-content: space-between; margin-bottom: 12px; flex-wrap: wrap; }
.req .meta { font-size: .85rem; color: var(--muted); }
.req dl { margin: 8px 0; display: grid; grid-template-columns: auto 1fr; gap: 2px 10px; font-size: .92rem; }
.req dt { color: var(--muted); }
.req dd { margin: 0; white-space: pre-line; }

.ai-box { border-color: var(--accent); background: linear-gradient(var(--accent-soft), var(--card) 70%); }
.ai-polish { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 6px; }
.ai-polish button { font: inherit; font-size: .8rem; padding: 4px 10px; border-radius: 999px; border: 1px solid var(--line); background: var(--card); color: var(--muted); cursor: pointer; }
.ai-polish button:hover:not(:disabled) { color: var(--accent); border-color: var(--accent); }
.ai-polish button[data-undo] { color: var(--danger); }

/* home */
.banner { width: 100%; height: auto; aspect-ratio: 911 / 364; object-fit: cover; border-radius: 20px; margin-bottom: 14px; background: #18629a; }
.hero-cta { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 14px; }
.urgent-card { padding: 12px 14px; margin-bottom: 12px; border-color: var(--danger); }
.urgent-card .t { margin: 4px 0 2px; font-weight: 700; }
.urgent-card .s { color: var(--muted); font-size: .9rem; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.sec-head { display: flex; align-items: baseline; justify-content: space-between; gap: 10px; }
.sec-head a { font-size: .9rem; text-decoration: none; white-space: nowrap; }
.home-cols { display: grid; gap: 0 24px; }
.notify-box { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; margin-top: 20px; }
.notify-box p { margin: 2px 0 0; }

/* AI search */
.ai-search { background: var(--card); border: 1px solid var(--accent); border-radius: var(--radius); padding: 12px 14px; margin-bottom: 14px; }
.ai-row { display: flex; gap: 8px; }
.ai-row input { flex: 1; min-width: 0; }
.ai-row .btn { flex: none; }
.small { font-size: .8rem; margin: 6px 0 0; }
.why { font-size: .82rem; color: var(--text); background: var(--accent-soft); border-radius: 8px; padding: 6px 8px; margin: 8px 0 0; }

/* home feed: dogs with likes, comments, donations */
.feed { display: grid; gap: 16px; margin-bottom: 8px; }
.feed-card { display: flex; flex-direction: column; }
.feed-ph { position: relative; display: flex; align-items: center; justify-content: center; aspect-ratio: 4 / 3; overflow: hidden; background: var(--accent-soft); font-size: 4rem; text-decoration: none; }
.feed-ph img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.feed-card .in { padding: 12px 14px 4px; flex: 1; }
.feed-card a.t { color: var(--text); text-decoration: none; font-size: 1.2rem; }
.feed-text { color: var(--text); font-size: .95rem; margin: 6px 0 0; display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
.acts { display: flex; align-items: center; gap: 4px; padding: 8px 10px 12px; flex-wrap: wrap; }
.acts .btn { margin-left: auto; }
.act {
  display: inline-flex; align-items: center; gap: 5px; padding: 7px 10px; border-radius: 999px; border: 0; background: none;
  color: var(--muted); font: inherit; font-size: .92rem; font-weight: 600; cursor: pointer; text-decoration: none;
}
.act:hover { background: var(--accent-soft); color: var(--accent); }
.act.on { color: var(--danger); }
.act:disabled { opacity: .6; }
.dog-acts { padding: 4px 0; margin-top: 8px; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.comment { padding: 10px 0; border-bottom: 1px solid var(--line); }
.comment p { margin: 4px 0 0; overflow-wrap: anywhere; }
.c-head { display: flex; justify-content: space-between; gap: 10px; font-size: .9rem; }
.c-form { margin-top: 14px; }
dialog#donate { border: 0; padding: 0; border-radius: 20px; background: var(--card); color: var(--text); width: min(420px, calc(100% - 32px)); box-shadow: 0 10px 40px rgba(10, 30, 60, .3); }
dialog#donate::backdrop { background: rgba(10, 25, 45, .55); }
dialog#donate .sheet { padding: 20px 20px 8px; position: relative; text-align: center; }
dialog#donate h2 { margin: 0 32px 8px; }
dialog#donate .qr { margin: 8px auto; }
dialog#donate .close { position: absolute; top: 10px; right: 10px; color: var(--muted); }

/* dog page */
.back { margin: 0 0 10px; }
.back a { text-decoration: none; font-size: .9rem; }
.gallery-empty { aspect-ratio: 1; border-radius: var(--radius); background: var(--accent-soft); display: flex; align-items: center; justify-content: center; font-size: 5rem; margin-bottom: 12px; }

/* desktop: navigation moves to the header, wider grid, two-column dog page */
@media (min-width: 900px) {
  body { padding-bottom: 0; }
  .top { padding: 10px max(24px, calc((100% - 1100px) / 2)); gap: 24px; flex-wrap: nowrap; }
  .tabs { order: 0; flex: 1; justify-content: stretch; gap: 6px; margin: 0; padding: 0; }
  .tabs a { flex: 1; justify-content: center; flex-direction: row; gap: 8px; font-size: 1rem; padding: 10px 8px; }
  .tabs a .ic { width: 20px; height: 20px; padding: 0; background: none !important; box-shadow: none !important; color: inherit !important; }
  .tabs a { color: rgba(255, 255, 255, .82); }
  .tabs a:hover { background: rgba(255, 255, 255, .14); color: #fff; }
  .tabs a.on { background: none; color: #18629a; box-shadow: none; }
  .tab-pill { border-radius: 12px; }
  .tabs a.staff-tab.show { display: flex; }
  .brand { flex: none; display: flex !important; }
  .back-btn, .page-title { display: none !important; }
  .desk-only { display: block; }
  .quick { margin-bottom: 24px; }
  .quick a { flex-direction: row; justify-content: center; gap: 10px; padding: 16px 8px; font-size: 1rem; }
  .m-group { max-width: 720px; }
  main { max-width: 1100px; padding: 24px; }
  .grid { grid-template-columns: repeat(auto-fill, minmax(210px, 1fr)); gap: 18px; }
  .card { transition: transform .15s, box-shadow .15s; }
  a.card:hover { transform: translateY(-2px); box-shadow: 0 6px 22px rgba(20, 50, 90, .14); }
  .banner { max-height: 340px; }
  .home-cols { grid-template-columns: 1fr 1fr; }
  .feed { grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); gap: 20px; }
  .dog-layout { display: grid; grid-template-columns: minmax(0, 1.1fr) minmax(0, 1fr); gap: 32px; align-items: start; }
  .dog-media { position: sticky; top: 84px; }
  .gallery { margin: 0; padding: 0; }
  .gallery img, .gallery video, .gallery .gal-fit { width: 100%; }
  .sticky-cta { position: static; }
  #toast { bottom: 24px; }
  .list .post .ph { width: 110px; height: 110px; }
  form#adopt, form#dog, form#post, form#help, form#push { max-width: 720px; }
}

/* daily dog-world news: the picture is drawn by GigaChat */
.ai-cap { color: var(--muted); font-size: .75rem; margin: 4px 12px 0; }
.cover + .ai-cap, .cover-fit + .ai-cap { margin: -6px 0 8px; }
/* «Отдам / обменяю» */
.badge.give { background: #dff3e7; color: var(--ok); }
.badge.swap { background: #fdf0d8; color: #9a6a00; }
.contact-box { background: var(--accent-soft); border-radius: var(--radius); padding: 12px 14px; }
.filters input[type=search] { flex: 1 0 180px; width: auto; padding: 8px 12px; border-radius: 999px; border: 1px solid var(--line); background: var(--card); color: var(--text); font-size: .9rem; }
.btn.ghost.danger { background: none; color: var(--danger); border-color: var(--danger); }
@media (prefers-color-scheme: dark) {
  .badge.give { background: #1d3427; color: #7fd1a1; }
  .badge.swap { background: #3a2f14; color: #f0c46a; }
}
.mk-cta { margin: 0 0 16px; }
.mk-filters { flex-wrap: wrap; overflow: visible; }
.mk-filters select { flex: 1 1 160px; }
/* «Отдам / обменяю»: rules */
.rules { margin: 0; padding: 0 16px 12px 34px; }
.rules li { margin: 6px 0; }
.rules-flat { padding: 0 0 6px; }
.rules-h { margin: 10px 16px 2px; font-size: 1rem; }
/* «Статьи ветеринаров» */
.lead { font-weight: 600; font-size: 1.05rem; }
.article h2 { font-size: 1.15rem; margin: 18px 0 6px; }
.article p { margin: 0 0 12px; line-height: 1.55; }
.article ul { margin: 0 0 12px; padding-left: 22px; line-height: 1.5; }
.clamp2 { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; margin: 4px 0 0; }

/* «Всё о шпицах»: polls, quizzes, topic chips */
.chips { display: flex; gap: 8px; overflow-x: auto; padding-bottom: 6px; margin-bottom: 10px; scrollbar-width: none; }
.chip { flex: none; padding: 7px 14px; border-radius: 999px; border: 1px solid var(--line); background: var(--card); color: var(--text); font: inherit; font-size: .9rem; cursor: pointer; }
.chip.on { background: var(--accent); border-color: var(--accent); color: #fff; }
.poll .badge { margin-bottom: 6px; }
.poll-q { font-weight: 700; font-size: 1.05rem; margin: 4px 0 10px; }
.poll-opts { display: flex; flex-direction: column; gap: 8px; margin-bottom: 8px; }
.poll-opt { position: relative; display: flex; justify-content: space-between; gap: 10px; width: 100%; text-align: left; padding: 11px 14px; border-radius: 12px; border: 1px solid var(--line);
  background: var(--card); color: var(--text); font: inherit; cursor: pointer; overflow: hidden; }
.poll-opt:hover:not(:disabled) { border-color: var(--accent); }
.poll-opt.res { background: linear-gradient(90deg, var(--accent-soft) var(--p), var(--card) var(--p)); }
.poll-opt.mine { border-color: var(--accent); font-weight: 600; }
.poll-opt b { color: var(--accent); }
.poll-opt.right { border-color: var(--ok); background: #dff3e7; color: #1d5c3a; }
.poll-opt.wrong { border-color: var(--danger); background: #fbe1df; color: #7a2520; }
.poll-opt:disabled { cursor: default; }
.quiz { max-width: 560px; margin: 0 auto; }
.quiz-ic { font-size: 3rem; text-align: center; margin-top: 8px; }
.quiz h1 { text-align: center; }
.quiz .lead, .quiz > .muted { text-align: center; }
.quiz h2 { margin: 6px 0 14px; font-size: 1.2rem; }
.quiz-prog { height: 6px; border-radius: 3px; background: var(--accent-soft); overflow: hidden; margin: 6px 0 8px; }
.quiz-prog i { display: block; height: 100%; background: var(--accent); transition: width .3s; }
.quiz-ex { margin: 4px 0 12px; }
.quiz-ex.ok { border-color: var(--ok); }
.quiz-ex.no { border-color: var(--danger); }
.quiz-ex p { margin: 6px 0 0; }
.quiz .hero-cta { justify-content: center; }
.quiz-card .ph { font-size: 2.4rem; }
@media (prefers-color-scheme: dark) {
  .poll-opt.right { background: #173d2a; color: #bfe8cf; }
  .poll-opt.wrong { background: #46201d; color: #f3c4bf; }
}

/* ---------- chat: messenger bubbles ---------- */
.chat-wrap { position: relative; flex: 1; min-height: 0; display: flex; border-radius: 18px; overflow: hidden;
  background: var(--chat-bg) ; background-image: radial-gradient(circle at 20px 20px, var(--chat-dot) 2px, transparent 2.5px), radial-gradient(circle at 60px 50px, var(--chat-dot) 1.5px, transparent 2px);
  background-size: 80px 80px; }
:root { --chat-bg: #dfeaf5; --chat-dot: rgba(27, 101, 163, .09); --bubble: #ffffff; --bubble-own: linear-gradient(135deg, #2a78bd, #1b65a3); --bubble-own-ink: #fff; }
.chat-list { flex: 1; overflow-y: auto; display: flex; flex-direction: column; padding: 10px 10px 12px; overscroll-behavior: contain; scroll-behavior: auto; }
.chat-list > .btn { align-self: center; margin-bottom: 8px; }
.chat-list > .btn[hidden] { display: none; }
.chat-list .empty { margin: auto; }
.chat-day { align-self: center; position: sticky; top: 4px; z-index: 2; margin: 10px 0 6px; }
.chat-day span { display: inline-block; padding: 3px 12px; border-radius: 999px; background: rgba(13, 40, 70, .38); color: #fff; font-size: .78rem; font-weight: 600; backdrop-filter: blur(6px); }

.msg-row { display: flex; align-items: flex-end; gap: 6px; margin-top: 8px; position: relative; touch-action: pan-y; transition: transform .15s; }
.msg-row.cont { margin-top: 2px; }
.msg-row.own { flex-direction: row-reverse; }
.msg-av { flex: none; width: 34px; height: 34px; border-radius: 50%; display: grid; place-items: center; color: #fff; font-weight: 700; font-size: .95rem; overflow: hidden; visibility: hidden; }
.msg-row.last .msg-av { visibility: visible; }
.msg-av img { width: 100%; height: 100%; object-fit: cover; }
.msg-av.team { background: #fff; }
.msg-av.bot { background: #8f6ee0; }

.msg { position: relative; max-width: min(78%, 520px); min-width: 64px; background: var(--bubble); color: var(--text); padding: 6px 10px 6px 12px;
  border-radius: 18px; box-shadow: 0 1px 1.5px rgba(16, 42, 70, .14); cursor: pointer; animation: msg-in .18s ease-out; }
@keyframes msg-in { from { opacity: 0; transform: translateY(6px) scale(.98); } to { opacity: 1; transform: none; } }
.msg-row:not(.own).last .msg { border-bottom-left-radius: 6px; }
.msg-row.own.last .msg { border-bottom-right-radius: 6px; }
.msg-row:not(.own).cont .msg { border-top-left-radius: 6px; }
.msg-row.own.cont .msg { border-top-right-radius: 6px; }
.msg-row:not(.own):not(.last) .msg { border-bottom-left-radius: 6px; }
.msg-row.own:not(.last) .msg { border-bottom-right-radius: 6px; }
.msg-row.own .msg { background: var(--bubble-own); color: var(--bubble-own-ink); }
.msg-row:not(.own) .msg.team { background: var(--accent-soft); }
.msg.vet { box-shadow: inset 3px 0 0 #1d9a8c, 0 1px 1.5px rgba(16, 42, 70, .14); }
.msg.bot { background: #f3eefe; }
.msg-name { font-size: .82rem; font-weight: 700; margin-bottom: 1px; display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.msg-row.cont .msg-name { display: none; }
.msg .badge { padding: 0 7px; font-size: .68rem; }
.msg .badge.bot { background: #e4dbf7; color: #5b3fa8; }
.msg-text { overflow-wrap: anywhere; line-height: 1.38; }
.msg.bot .msg-text a { color: #5b3fa8; overflow-wrap: anywhere; }
.msg-row.own .msg-text a { color: #fff; }
.msg-meta { float: right; margin: 6px 0 -4px 10px; font-size: .7rem; opacity: .6; white-space: nowrap; line-height: 1.6; user-select: none; }
.msg-row.own .msg-meta { opacity: .8; }
.msg.only-media { padding: 4px; }
.msg.only-media > .msg-meta { position: absolute; right: 10px; bottom: 9px; margin: 0; padding: 1px 7px; border-radius: 999px; background: rgba(0, 0, 0, .45); color: #fff; opacity: 1; }
.msg.has-media .msg-name { padding: 2px 6px 0; }
.msg-media { display: block; max-width: 100%; max-height: 340px; border-radius: 13px; margin: 2px 0 4px; background: #0001; }
.msg.only-media .msg-media { margin: 0; }
video.msg-media { width: 100%; max-width: 420px; background: #000; }
.msg-photo { display: block; }
.msg-quote { display: flex; flex-direction: column; align-items: flex-start; width: 100%; text-align: left; border: 0; cursor: pointer; font: inherit; color: inherit;
  margin: 2px 0 4px; padding: 3px 8px; border-radius: 8px; background: color-mix(in srgb, var(--qc) 12%, transparent); box-shadow: inset 3px 0 0 var(--qc); }
.msg-quote b { color: var(--qc); font-size: .8rem; }
.msg-quote span { font-size: .85rem; opacity: .85; max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.msg-row.own .msg-quote { --qc: #fff !important; background: rgba(255, 255, 255, .16); }
.msg-reply-btn { align-self: center; flex: none; width: 30px; height: 30px; border-radius: 50%; border: 0; background: var(--card); color: var(--muted);
  box-shadow: 0 1px 3px rgba(16, 42, 70, .2); cursor: pointer; opacity: 0; transition: opacity .15s; font-size: .95rem; }
.msg-row:hover .msg-reply-btn { opacity: 1; }
@media (hover: none) { .msg-reply-btn { display: none; } }
.msg-row.swiping::after { content: '↩'; position: absolute; right: -36px; top: 50%; transform: translateY(-50%); width: 30px; height: 30px; border-radius: 50%; background: var(--accent); color: #fff; display: grid; place-items: center; }
.msg-row.picked .msg { filter: brightness(.94); }
.msg-row.flash .msg { animation: flash 1.2s ease-out; }
@keyframes flash { 0%, 30% { box-shadow: 0 0 0 3px var(--accent); } 100% { box-shadow: 0 1px 1.5px rgba(16, 42, 70, .14); } }

.msg-menu { position: fixed; z-index: 60; min-width: 210px; background: var(--card); border-radius: 14px; padding: 6px; box-shadow: 0 10px 30px rgba(10, 30, 60, .25); animation: menu-in .12s ease-out; }
@keyframes menu-in { from { opacity: 0; transform: scale(.95); } to { opacity: 1; transform: none; } }
.msg-menu button { display: flex; align-items: center; gap: 12px; width: 100%; padding: 10px 12px; border: 0; background: none; border-radius: 10px; color: var(--text); font: inherit; cursor: pointer; text-align: left; }
.msg-menu button:hover { background: var(--accent-soft); }
.msg-menu button.danger { color: var(--danger); }
.msg-menu span { width: 22px; text-align: center; }

.chat-down { position: absolute; right: 12px; bottom: 12px; z-index: 3; width: 44px; height: 44px; border-radius: 50%; border: 0; background: var(--card); color: var(--accent);
  font-size: 1.3rem; cursor: pointer; box-shadow: 0 2px 10px rgba(10, 30, 60, .25); }
.chat-down[hidden] { display: none; }
.chat-down b { position: absolute; top: -6px; right: -4px; min-width: 20px; padding: 0 5px; border-radius: 999px; background: var(--accent); color: #fff; font-size: .7rem; line-height: 20px; }
.chat-down b:empty { display: none; }

.chat-form { padding-top: 8px; display: flex; flex-direction: column; gap: 6px; }
.chat-as { margin: 0; font-size: .72rem; text-align: center; }
.chat-row { display: flex; gap: 8px; align-items: flex-end; }
.chat-input { flex: 1; display: flex; align-items: flex-end; background: var(--card); border: 1px solid var(--line); border-radius: 24px; padding: 2px 4px; box-shadow: 0 1px 3px rgba(16, 42, 70, .08); }
.chat-input:focus-within { border-color: var(--accent); }
.chat-input textarea { flex: 1; resize: none; min-height: 42px; max-height: 140px; border: 0; background: none; padding: 10px 4px; box-shadow: none; outline: none; line-height: 1.35; }
.chat-icon { flex: none; width: 40px; height: 42px; display: grid; place-items: center; border: 0; background: none; font-size: 1.3rem; cursor: pointer; border-radius: 50%; opacity: .8; }
.chat-icon:hover { opacity: 1; }
.chat-send { flex: none; width: 48px; height: 48px; border-radius: 50%; border: 0; background: var(--bubble-own); color: #fff; font-size: 1.2rem; cursor: pointer;
  box-shadow: 0 2px 8px rgba(27, 101, 163, .35); transition: transform .12s, opacity .12s; }
.chat-send:active { transform: scale(.92); }
.chat-send:disabled { opacity: .6; }
.chat-form:not(.typed) .chat-send { opacity: .75; }
.chat-bar { display: flex; align-items: center; gap: 10px; padding: 6px 8px 6px 12px; border-radius: 14px; background: var(--card); box-shadow: inset 3px 0 0 var(--accent); font-size: .85rem; }
.chat-bar[hidden] { display: none; }
.chat-bar-ic { font-style: normal; font-size: 1.1rem; }
.chat-bar-tx { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.chat-bar-tx b { color: var(--accent); font-size: .8rem; }
.chat-bar-tx span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; opacity: .8; }
.chat-bar button { border: 0; background: none; cursor: pointer; font-size: 1rem; color: var(--muted); padding: 6px; }
@media (prefers-color-scheme: dark) {
  :root { --chat-bg: #0f1d2e; --chat-dot: rgba(91, 167, 230, .07); --bubble: #1b2d44; --bubble-own: linear-gradient(135deg, #2f73b0, #235d93); }
  .msg.bot { background: #261f3d; }
  .msg .badge.bot { background: #3a2f5f; color: #cbbcf5; }
  .msg.bot .msg-text a { color: #cbbcf5; }
  .msg-av.team { background: #e8f0f8; }
}

/* spitz stickers */
.sp-emo { display: inline-block; width: 1.6em; height: 1.6em; vertical-align: -0.45em; margin: 0 1px; }
.sp-emo.tab { width: 1.4em; height: 1.4em; vertical-align: middle; }
.spitz-grid { grid-template-columns: repeat(auto-fill, minmax(64px, 1fr)); max-height: 240px; }
.spitz-grid button { height: 70px; }
.spitz-grid .sp-emo { width: 58px; height: 58px; margin: 0; transition: transform .12s; }
.spitz-grid button:hover .sp-emo { transform: scale(1.1); }
.spitz-hint { margin: 0; padding: 0 10px 8px; font-size: .72rem; }
.msg.sticker { background: none !important; box-shadow: none !important; padding: 0; }
.msg.sticker .msg-text { display: flex; flex-wrap: wrap; align-items: flex-end; gap: 2px; }
.msg.sticker .sp-emo { width: 112px; height: 112px; margin: 0; filter: drop-shadow(0 2px 3px rgba(16, 42, 70, .2)); }
.msg.sticker .msg-meta { float: none; align-self: flex-end; margin: 0 0 4px 4px; padding: 1px 7px; border-radius: 999px; background: rgba(13, 40, 70, .35); color: #fff; opacity: 1; }
.msg.sticker .msg-name { padding: 2px 8px; border-radius: 999px; background: var(--bubble); align-self: flex-start; display: inline-flex; }
.msg-row.cont .msg.sticker .msg-name { display: none; }

/* ===== motion & polish layer (site-wide) ===== */
:root { --spring: cubic-bezier(.2, .9, .3, 1.25); --glow: rgba(27, 101, 163, .25); }
@media (prefers-color-scheme: dark) { :root { --glow: rgba(91, 167, 230, .3); } }
/* soft drifting colour blobs behind everything */
body::before { content: ''; position: fixed; inset: -20%; z-index: -1; pointer-events: none;
  background: radial-gradient(40% 35% at 15% 20%, rgba(42, 134, 207, .14), transparent 70%),
    radial-gradient(35% 30% at 85% 35%, rgba(120, 90, 220, .09), transparent 70%),
    radial-gradient(40% 35% at 50% 90%, rgba(30, 170, 150, .09), transparent 70%);
  animation: bg-drift 30s ease-in-out infinite alternate; }
@keyframes bg-drift { to { transform: translate3d(4%, -3%, 0) rotate(6deg); } }

/* page title with an accent stroke */
main > h1, main > * > h1 { position: relative; padding-bottom: 6px; }
main > h1::after, main > * > h1::after { content: ''; position: absolute; left: 0; bottom: 0; width: 42px; height: 4px; border-radius: 4px;
  background: linear-gradient(90deg, var(--accent), #7a5cd6); transform-origin: left; animation: bar-in .6s .15s var(--spring) both; }
@keyframes bar-in { from { transform: scaleX(0); } }

/* cards: reveal on scroll, lift on hover, photo zoom, shimmer while photos load */
.rv:not(.in) { opacity: 0; }
.rv.in { animation: rv-in .55s cubic-bezier(.2, .8, .3, 1) backwards; }
@keyframes rv-in { from { opacity: 0; transform: translateY(22px) scale(.98); } }
.card, .box, .feed-card { transition: transform .3s var(--spring), box-shadow .3s, border-color .3s; }
a.card:hover, .feed-card:hover, .wall:hover { transform: translateY(-3px); box-shadow: 0 12px 28px rgba(20, 60, 110, .14); border-color: color-mix(in srgb, var(--accent) 35%, var(--line)); }
a.card:active { transform: scale(.985); }
.card .ph, .feed-ph { overflow: hidden; }
.card .ph img, .feed-ph img, .wall-ph { transition: transform .6s cubic-bezier(.2, .8, .3, 1); }
a.card:hover .ph img, .feed-card:hover .feed-ph img, .wall:hover .wall-ph { transform: scale(1.05); }
.card .ph:has(img), .feed-ph:has(img), .gallery img { background-image: linear-gradient(100deg, transparent 30%, rgba(255, 255, 255, .45) 50%, transparent 70%);
  background-size: 200% 100%; animation: shimmer 1.4s linear infinite; }
@keyframes shimmer { from { background-position: 150% 0; } to { background-position: -50% 0; } }
@media (prefers-color-scheme: dark) { .card .ph:has(img), .feed-ph:has(img), .gallery img { background-image: linear-gradient(100deg, transparent 30%, rgba(255, 255, 255, .08) 50%, transparent 70%); } }

/* buttons: gradient, shine on hover, press */
.btn { position: relative; overflow: hidden; background-image: linear-gradient(135deg, rgba(255, 255, 255, .18), transparent 60%);
  box-shadow: 0 4px 14px var(--glow); transition: transform .25s var(--spring), box-shadow .25s, filter .2s; -webkit-tap-highlight-color: transparent; }
.btn::after { content: ''; position: absolute; inset: 0; transform: translateX(-120%); pointer-events: none;
  background: linear-gradient(100deg, transparent 30%, rgba(255, 255, 255, .35) 50%, transparent 70%); }
.btn:hover:not(:disabled) { transform: translateY(-2px); box-shadow: 0 8px 22px var(--glow); }
.btn:hover:not(:disabled)::after { transform: translateX(120%); transition: transform .7s ease; }
.btn:active:not(:disabled) { transform: scale(.96); }
.btn.ghost { background-image: none; box-shadow: none; }
.btn.ghost:hover:not(:disabled) { box-shadow: 0 4px 12px var(--glow); }
.btn.danger { box-shadow: 0 4px 14px rgba(196, 65, 58, .3); }
.btn .m-ripple, .tabs a .m-ripple { background: #fff; opacity: .3; }
.act { position: relative; overflow: hidden; transition: background .2s, color .2s, transform .2s var(--spring); -webkit-tap-highlight-color: transparent; }
.act:active { transform: scale(.92); }
.heart { display: inline-block; }
.heart.burst { animation: heart-burst .6s var(--spring); }
@keyframes heart-burst { 0% { transform: scale(1); } 30% { transform: scale(1.5) rotate(-12deg); } 60% { transform: scale(.9) rotate(6deg); } 100% { transform: scale(1); } }

/* fields: soft glow ring */
input, textarea, select { transition: border-color .2s, box-shadow .25s, background .2s; }
input:focus, textarea:focus, select:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 4px var(--glow); }
.check input:focus { box-shadow: none; outline: 2px solid var(--accent); }

/* segmented switch, steps, badges, urgent */
.seg a { position: relative; overflow: hidden; transition: background .3s, color .3s, box-shadow .3s; }
.st-n { background: linear-gradient(145deg, #3a8fd6, var(--accent)); box-shadow: 0 4px 10px var(--glow); }
.steps li.in .st-n { animation: st-pop .5s .15s var(--spring) backwards; }
@keyframes st-pop { from { transform: scale(0) rotate(-90deg); } }
.urgent-card { animation: urgent-glow 2.4s ease-in-out infinite; }
@keyframes urgent-glow { 0%, 100% { box-shadow: 0 0 0 0 rgba(196, 65, 58, .0); } 50% { box-shadow: 0 0 0 5px rgba(196, 65, 58, .15); } }
.badge.urgent::before { content: ''; display: inline-block; width: 6px; height: 6px; margin-right: 5px; vertical-align: 1px; border-radius: 50%; background: currentColor; animation: dot-blink 1.2s ease-in-out infinite; }
@keyframes dot-blink { 50% { opacity: .2; } }
.facts span { transition: transform .2s var(--spring), background .2s; }
.facts span:hover { transform: translateY(-2px); background: var(--accent-soft); }
.banner { animation: banner-in .7s cubic-bezier(.2, .8, .3, 1) both; }
@keyframes banner-in { from { opacity: 0; transform: scale(.97); filter: blur(4px); } }
.ai-search { box-shadow: 0 6px 20px var(--glow); }

/* loading: a bouncing paw trio instead of plain text */
.spinner::before { content: '🐾 🐾 🐾'; display: block; font-size: 1.6rem; margin-bottom: 8px; animation: paws 1s ease-in-out infinite; letter-spacing: 4px; }
@keyframes paws { 0%, 100% { transform: translateY(0); opacity: .5; } 50% { transform: translateY(-8px); opacity: 1; } }
.empty b { display: inline-block; animation: m-bob 3s ease-in-out infinite; }

/* toast and donate sheet spring in */
#toast { transition: opacity .25s, transform .4s var(--spring); border-radius: 14px; box-shadow: 0 10px 30px rgba(10, 30, 60, .3); }
dialog#donate[open] { animation: sheet-in .45s var(--spring); }
dialog#donate[open]::backdrop { backdrop-filter: blur(4px); animation: fade-in .3s ease; }
@keyframes sheet-in { from { opacity: 0; transform: translateY(30px) scale(.95); } }
@keyframes fade-in { from { opacity: 0; } }
details.inst > :not(summary) { animation: fade-in .35s ease; }

/* ===== admin ===== */
.adm-nav a .ic { width: 26px; height: 26px; padding: 5px; margin-left: -6px; border-radius: 50%; color: #fff;
  background: linear-gradient(145deg, hsl(var(--h) 75% 62%), hsl(var(--h) 65% 42%)); transition: transform .35s var(--spring); }
.adm-nav a:hover .ic { transform: rotate(-12deg) scale(1.12); }
.adm-nav a.on .ic { background: rgba(255, 255, 255, .25); }
.adm-nav { padding: 4px 2px 8px; }
.adm-nav a { display: inline-flex; align-items: center; gap: 6px; font-weight: 600; transition: transform .25s var(--spring), background .25s, color .25s, box-shadow .25s, border-color .25s; }
.adm-nav a:hover { transform: translateY(-2px); border-color: var(--accent); color: var(--accent); box-shadow: 0 4px 12px var(--glow); }
.adm-nav a.on { background: linear-gradient(135deg, #3a8fd6, #18629a); border-color: transparent; color: #fff; box-shadow: 0 6px 16px var(--glow); animation: nav-on .45s var(--spring); }
@keyframes nav-on { from { transform: scale(.85); } }
.adm-nav .cnt { min-width: 20px; height: 20px; padding: 0 6px; border-radius: 999px; background: var(--danger); color: #fff; font-size: .72rem; font-weight: 700;
  display: inline-grid; place-items: center; animation: cnt-pulse 2s ease-in-out infinite; }
.adm-nav a.on .cnt { background: #fff; color: var(--danger); }
@keyframes cnt-pulse { 0%, 100% { box-shadow: 0 0 0 0 rgba(196, 65, 58, .45); } 60% { box-shadow: 0 0 0 6px rgba(196, 65, 58, 0); } }
.adm-nav-arrow { transition: transform .2s var(--spring), opacity .2s; }
.adm-nav-arrow:hover:not(:disabled) { transform: translateY(-50%) scale(1.1); }

.adm-hero { position: relative; overflow: hidden; display: flex; align-items: center; justify-content: space-between; gap: 14px; padding: 20px 20px; margin-bottom: 14px;
  border-radius: 22px; color: #fff; background: linear-gradient(125deg, #2a86cf, #18629a 45%, #0f3d63); background-size: 200% 200%;
  box-shadow: 0 10px 28px rgba(16, 70, 120, .35); animation: m-pop .55s var(--spring) both, m-flow 10s ease-in-out infinite alternate; }
.adm-hero::before { content: '🐾'; position: absolute; right: 90px; top: -10px; font-size: 5rem; opacity: .08; transform: rotate(-20deg); }
.adm-hero small { opacity: .8; }
.adm-hero h1 { margin: 0; padding: 0; font-size: 1.5rem; overflow-wrap: anywhere; }
.adm-hero h1::after { display: none; }
.adm-hero p { margin: 4px 0 0; opacity: .85; font-size: .9rem; }
.adm-hero img { flex: none; border-radius: 50%; background: #fff; box-shadow: 0 0 0 4px rgba(255, 255, 255, .25); animation: m-bob 4s ease-in-out infinite; }
.adm-stats { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 10px; margin-bottom: 14px; }
.adm-stat { position: relative; overflow: hidden; display: flex; flex-direction: column; gap: 2px; padding: 14px; border-radius: 18px; text-decoration: none; color: var(--text);
  background: var(--card); border: 1px solid var(--line); box-shadow: var(--shadow);
  animation: m-rise .5s var(--spring) both; animation-delay: calc(.1s + var(--i) * 70ms); transition: transform .25s var(--spring), box-shadow .25s; }
.adm-stat::after { content: ''; position: absolute; right: -30px; bottom: -30px; width: 90px; height: 90px; border-radius: 50%; background: hsl(var(--h) 70% 55% / .12); transition: transform .5s var(--spring); }
.adm-stat:hover { transform: translateY(-3px); box-shadow: 0 12px 26px hsl(var(--h) 60% 45% / .2); }
.adm-stat:hover::after { transform: scale(1.6); }
.adm-stat-ic { width: 38px; height: 38px; border-radius: 12px; display: grid; place-items: center; font-size: 1.2rem; margin-bottom: 6px;
  background: linear-gradient(145deg, hsl(var(--h) 75% 62%), hsl(var(--h) 65% 42%)); box-shadow: 0 4px 10px hsl(var(--h) 60% 45% / .3); }
.adm-stat b { font-size: 1.8rem; line-height: 1.1; font-variant-numeric: tabular-nums; }
.adm-stat small { color: var(--muted); font-size: .82rem; }
.adm-stat.hot { border-color: hsl(var(--h) 65% 55% / .6); }
.adm-stat.hot .adm-stat-ic { animation: m-wiggle 1s 1s ease 2; }
/* admin home: sections as tiles; inside a section only «‹ Все разделы» */
.adm-back { margin: 0 0 12px; }
.adm-tiles-h { font-size: .8rem; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); margin: 18px 0 8px; }
.adm-tiles-h::after { display: none; }
.adm-tiles { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 10px; }
/* .adm-tile is an .adm-stat card (same look as the counters on top), with the section name instead of a number */
.adm-tile { min-height: 112px; justify-content: space-between; animation-delay: calc(.15s + var(--i) * 35ms); }
.adm-tile .adm-stat-ic { width: 44px; height: 44px; font-size: 1.35rem; margin-bottom: 8px; }
.adm-tile-t { position: relative; z-index: 1; font-weight: 700; font-size: .95rem; line-height: 1.25; }
.adm-tile:hover .adm-stat-ic { transform: rotate(-10deg) scale(1.1); }
.adm-tile .adm-stat-ic { transition: transform .35s var(--spring); }
.adm-tile .cnt { position: absolute; top: 12px; right: 12px; min-width: 24px; height: 24px; padding: 0 7px; border-radius: 999px; background: var(--danger); color: #fff;
  font-size: .78rem; display: grid; place-items: center; animation: cnt-pulse 2s ease-in-out infinite; }
@media (max-width: 380px) { .adm-tiles { grid-template-columns: 1fr 1fr; } }
.adm-acts { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 10px; margin-bottom: 14px; }
.adm-act { position: relative; overflow: hidden; display: flex; align-items: center; gap: 10px; padding: 12px; border-radius: 16px; text-decoration: none; font-weight: 600; font-size: .92rem;
  color: var(--text); background: var(--card); border: 1px solid var(--line);
  animation: m-rise .5s var(--spring) both; animation-delay: calc(.2s + var(--i) * 60ms); transition: transform .25s var(--spring), background .25s; }
.adm-act span { flex: none; width: 36px; height: 36px; border-radius: 11px; display: grid; place-items: center; background: hsl(var(--h) 70% 50% / .14); transition: transform .35s var(--spring); }
.adm-act:hover { transform: translateY(-2px); background: hsl(var(--h) 70% 50% / .08); }
.adm-act:hover span { transform: rotate(-10deg) scale(1.12); }
.adm-chips { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 14px; animation: m-rise .5s .45s ease both; }
.adm-chip { display: inline-flex; align-items: center; gap: 7px; padding: 6px 12px; border-radius: 999px; font-size: .85rem; font-weight: 600; background: var(--card); border: 1px solid var(--line); }
.adm-chip i { width: 8px; height: 8px; border-radius: 50%; }
.adm-chip.ok i { background: var(--ok); box-shadow: 0 0 0 0 rgba(47, 143, 91, .5); animation: ok-ping 2.4s ease-out infinite; }
.adm-chip.warn { color: #9a6a00; border-color: #e7c66a; }
.adm-chip.warn i { background: #e0a800; }
@keyframes ok-ping { 70% { box-shadow: 0 0 0 7px rgba(47, 143, 91, 0); } 100% { box-shadow: 0 0 0 0 rgba(47, 143, 91, 0); } }
.adm-row { transition: transform .25s var(--spring), box-shadow .25s, border-color .25s; }
.adm-row:hover { transform: translateX(3px); border-color: color-mix(in srgb, var(--accent) 40%, var(--line)); box-shadow: 0 6px 18px var(--glow); }
.adm-row img { transition: transform .4s var(--spring); }
.adm-row:hover img { transform: scale(1.08) rotate(-2deg); }
.adm-photos > div { animation: m-rise .4s var(--spring) both; }
.adm-photos img { transition: transform .3s var(--spring), box-shadow .3s; }
.adm-photos img:hover { transform: scale(1.04); box-shadow: 0 8px 18px rgba(0, 0, 0, .2); }
.toolbar .btn { animation: m-pop .5s .2s var(--spring) both; }
.ai-box { position: relative; overflow: hidden; }
.ai-box::before { content: ''; position: absolute; inset: 0 0 auto; height: 3px; background: linear-gradient(90deg, #3a8fd6, #7a5cd6, #2fb5a0, #3a8fd6); background-size: 200% 100%; animation: ai-line 3s linear infinite; }
@keyframes ai-line { to { background-position: -200% 0; } }
.btn.thinking { background-image: linear-gradient(90deg, rgba(255, 255, 255, .0) 0%, rgba(255, 255, 255, .35) 50%, rgba(255, 255, 255, 0) 100%); background-size: 200% 100%; animation: shimmer 1s linear infinite; opacity: .85 !important; }
details.box summary { cursor: pointer; font-weight: 600; }
#login.box { box-shadow: 0 12px 30px var(--glow); animation: m-pop .5s var(--spring) both; }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; }
  body::before { animation: none; }
  .rv:not(.in) { opacity: 1; }
}

/* ===== «Всё о шпицах»: academy, quizzes with professor Spitz, polls ===== */
.mascot { display: block; width: 64px; height: 64px; flex: none; -webkit-user-drag: none; }
/* polls */
.poll { position: relative; overflow: visible; border-top: 4px solid hsl(var(--h) 65% 55%); }
.poll-head { display: flex; align-items: center; gap: 10px; margin-bottom: 4px; }
.poll-av { width: 52px; height: 52px; animation: m-bob 4s ease-in-out infinite; }
.poll-meta { color: var(--muted); font-size: .8rem; margin-top: 2px; }
.poll-q { font-size: 1.12rem; }
.poll-opt { align-items: center; overflow: hidden; isolation: isolate; transition: transform .2s var(--spring), border-color .2s, box-shadow .2s; animation: m-rise .4s var(--spring) backwards; animation-delay: calc(var(--i) * 50ms); }
.poll-opt:hover:not(:disabled) { transform: translateX(3px); box-shadow: 0 4px 12px var(--glow); }
.poll-opt:active:not(:disabled) { transform: scale(.98); }
.opt-l { flex: none; width: 28px; height: 28px; border-radius: 9px; display: grid; place-items: center; font-weight: 700; font-size: .85rem;
  background: hsl(var(--h, 210) 70% 50% / .14); color: hsl(var(--h, 210) 60% 38%); }
@media (prefers-color-scheme: dark) { .opt-l { color: hsl(var(--h, 210) 70% 72%); } }
.opt-t { flex: 1; min-width: 0; }
.opt-t em { font-style: normal; font-size: .75rem; font-weight: 700; color: #fff; background: var(--accent); border-radius: 999px; padding: 1px 7px; margin-left: 4px; white-space: nowrap; }
.poll-opt.res { background: var(--card); }
.poll-opt.res::before { content: ''; position: absolute; inset: 0; z-index: -1; width: var(--p); border-radius: 0 10px 10px 0;
  background: linear-gradient(90deg, hsl(var(--h) 70% 55% / .16), hsl(var(--h) 70% 55% / .28)); }
.poll.fresh .poll-opt.res::before { animation: bar-grow .9s cubic-bezier(.2, .8, .3, 1) backwards; animation-delay: calc(var(--i) * 70ms); }
@keyframes bar-grow { from { width: 0; } }
.poll-opt.res.lead::before { background: linear-gradient(90deg, hsl(var(--h) 70% 55% / .25), hsl(var(--h) 70% 55% / .45)); }
.poll-opt.mine { border-color: hsl(var(--h) 65% 50%); box-shadow: 0 0 0 3px hsl(var(--h) 65% 50% / .15); }
.poll-opt b { color: hsl(var(--h) 60% 40%); font-variant-numeric: tabular-nums; }
@media (prefers-color-scheme: dark) { .poll-opt b { color: hsl(var(--h) 70% 72%); } }
.poll-foot { display: flex; align-items: center; justify-content: space-between; gap: 8px; flex-wrap: wrap; }
/* confetti */
.confetti { position: absolute; left: 50%; top: 50%; width: 0; height: 0; pointer-events: none; z-index: 5; }
.poll-opt .confetti, .qz-ring .confetti { position: absolute; }
.confetti i { position: absolute; width: 7px; height: 11px; border-radius: 2px; background: var(--c); opacity: 0;
  animation: conf 1.1s cubic-bezier(.2, .6, .4, 1) var(--d) forwards; }
@keyframes conf { 0% { opacity: 1; transform: translate(0, 0) rotate(0); } 60% { opacity: 1; }
  100% { opacity: 0; transform: translate(var(--x), calc(var(--y) + 160px)) rotate(var(--r)); } }
.poll-opt { overflow: visible; }
.poll-opt.res { overflow: hidden; }
/* quiz cards */
.quiz-card { display: flex; gap: 14px; align-items: center; padding: 12px; }
.qc-art { position: relative; flex: none; width: 88px; height: 88px; border-radius: 22px; display: grid; place-items: center;
  background: radial-gradient(circle at 30% 25%, hsl(var(--h) 85% 85%), hsl(var(--h) 65% 62%)); box-shadow: inset 0 -6px 14px hsl(var(--h) 60% 40% / .25); }
@media (prefers-color-scheme: dark) { .qc-art { background: radial-gradient(circle at 30% 25%, hsl(var(--h) 50% 40%), hsl(var(--h) 50% 24%)); } }
.qc-art .mascot { width: 78px; height: 78px; transition: transform .4s var(--spring); }
.quiz-card:hover .qc-art .mascot { transform: rotate(-8deg) scale(1.08); }
.qc-topic { position: absolute; right: -4px; bottom: -4px; width: 30px; height: 30px; border-radius: 50%; background: var(--card); display: grid; place-items: center; font-size: 1rem; box-shadow: 0 2px 6px rgba(0, 0, 0, .15); }
.qc-body { flex: 1; min-width: 0; }
.qc-body .t { font-weight: 700; font-size: 1.05rem; margin: 3px 0 1px; }
.qc-body .s { color: var(--muted); font-size: .85rem; }
.qc-meta { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 10px; margin-top: 6px; font-size: .8rem; color: var(--muted); }
.qc-new { background: linear-gradient(135deg, #f39b3c, #e63950); color: #fff; font-weight: 700; padding: 2px 9px; border-radius: 999px; animation: dot-blink 2.4s ease-in-out infinite; }
.qc-done { color: var(--ok); font-weight: 700; }
.qc-done.perfect { color: #c99a22; }
.qc-go { margin-left: auto; color: hsl(var(--h) 60% 45%); font-weight: 700; transition: transform .25s var(--spring); }
.quiz-card:hover .qc-go { transform: translateX(4px); }
/* academy hub */
.ac-hero { position: relative; overflow: hidden; display: flex; align-items: center; gap: 14px; padding: 18px; border-radius: 22px; margin-bottom: 12px; color: #fff;
  background: linear-gradient(125deg, #7a5cd6, #3a6fcf 50%, #18629a); background-size: 200% 200%; box-shadow: 0 10px 28px rgba(60, 70, 160, .3);
  animation: m-pop .55s var(--spring) both, m-flow 10s ease-in-out infinite alternate; }
.ac-hero::after { content: '🎓'; position: absolute; right: -10px; top: -18px; font-size: 6rem; opacity: .1; transform: rotate(18deg); }
.ac-prof { width: 96px; height: 96px; filter: drop-shadow(0 6px 10px rgba(0, 0, 0, .25)); animation: m-bob 3.5s ease-in-out infinite; }
.ac-tx { flex: 1; min-width: 0; position: relative; z-index: 1; }
.ac-tx small { opacity: .85; text-transform: uppercase; letter-spacing: .08em; font-size: .72rem; font-weight: 700; }
.ac-tx h1 { margin: 2px 0 4px; padding: 0; color: #fff; }
.ac-tx h1::after { display: none; }
.ac-tx p { margin: 0 0 8px; opacity: .9; font-size: .9rem; }
.ac-prog { display: flex; align-items: center; gap: 10px; font-size: .8rem; font-weight: 600; }
.ac-bar { flex: 1; height: 8px; border-radius: 4px; background: rgba(255, 255, 255, .25); overflow: hidden; }
.ac-bar i { display: block; height: 100%; width: var(--w); border-radius: 4px; background: linear-gradient(90deg, #f2c14e, #fff3c4); animation: bar-grow 1.2s .3s cubic-bezier(.2, .8, .3, 1) backwards; }
.ach { display: flex; gap: 8px; overflow-x: auto; padding: 2px 2px 8px; margin-bottom: 8px; scrollbar-width: none; }
.ach-i { flex: none; width: 92px; display: flex; flex-direction: column; align-items: center; gap: 4px; padding: 10px 6px; border-radius: 16px; text-align: center;
  background: var(--card); border: 1px solid var(--line); filter: grayscale(1); opacity: .55; animation: m-rise .45s var(--spring) backwards; animation-delay: calc(.15s + var(--i) * 60ms); }
.ach-i b { font-size: 1.6rem; line-height: 1; }
.ach-i small { font-size: .7rem; font-weight: 600; line-height: 1.2; }
.ach-i.got { filter: none; opacity: 1; border-color: #f2c14e; background: linear-gradient(180deg, #fff8e1, var(--card)); box-shadow: 0 4px 12px rgba(242, 193, 78, .3); }
@media (prefers-color-scheme: dark) { .ach-i.got { background: linear-gradient(180deg, #3a3110, var(--card)); } }
.ach-i.got b { animation: m-wiggle 1s 1s ease 1; }
.ac-tabs { max-width: none; }
.ac-tabs a { display: flex; align-items: center; justify-content: center; gap: 4px; padding: 9px 4px; font-size: .86rem; white-space: nowrap; }
.ac-tabs small { font-size: .7rem; background: var(--accent-soft); color: var(--accent); border-radius: 999px; padding: 0 6px; }
.ac-tabs a.on small { background: var(--accent); color: #fff; }
#ac-pane > * { animation: fade-in .3s ease; }
.empty-m { width: 96px; height: 96px; margin: 0 auto 8px; }
/* quiz screens */
.quiz { --h: 210; }
.qz-intro, .qz-result { text-align: center; }
.qz-prof { width: 72px; height: 72px; transition: transform .3s var(--spring); }
.qz-prof.big { width: 140px; height: 140px; margin: 4px auto 0; filter: drop-shadow(0 8px 14px rgba(20, 50, 90, .2)); animation: m-pop .6s var(--spring) both, m-bob 3.5s .6s ease-in-out infinite; }
.qz-prof.yay { animation: prof-yay .6s var(--spring); }
.qz-prof.oops { animation: prof-oops .5s ease; }
@keyframes prof-yay { 0% { transform: scale(1); } 40% { transform: scale(1.2) translateY(-8px) rotate(-6deg); } 100% { transform: scale(1); } }
@keyframes prof-oops { 0%, 100% { transform: none; } 20%, 60% { transform: translateX(-6px) rotate(-4deg); } 40%, 80% { transform: translateX(6px) rotate(4deg); } }
.qz-bubble { position: relative; display: inline-block; max-width: 340px; margin: 10px auto 4px; padding: 10px 14px; border-radius: 16px; background: var(--card); border: 1px solid var(--line);
  box-shadow: var(--shadow); font-size: .92rem; animation: m-rise .5s .35s var(--spring) backwards; }
.qz-bubble::before { content: ''; position: absolute; left: 50%; top: -7px; width: 12px; height: 12px; background: var(--card); border-left: 1px solid var(--line); border-top: 1px solid var(--line); transform: translateX(-50%) rotate(45deg); }
.qz-intro h1::after, .qz-result h1::after { left: 50%; margin-left: -21px; }
.qz-chips { display: flex; flex-wrap: wrap; justify-content: center; gap: 6px; margin: 10px 0 14px; }
.qz-chips span { padding: 5px 11px; border-radius: 999px; background: var(--card); border: 1px solid var(--line); font-size: .85rem; animation: m-rise .4s var(--spring) backwards; }
.qz-chips span.mine { border-color: #f2c14e; background: linear-gradient(180deg, #fff8e1, var(--card)); }
@media (prefers-color-scheme: dark) { .qz-chips span.mine { background: linear-gradient(180deg, #3a3110, var(--card)); } }
.qz-modes { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-bottom: 14px; text-align: left; }
.qz-mode { margin: 0; cursor: pointer; position: relative; }
.qz-mode input { position: absolute; inset: 0; opacity: 0; margin: 0; pointer-events: none; }
.qz-mode span { display: flex; flex-direction: column; gap: 2px; height: 100%; padding: 12px; border-radius: 14px; border: 2px solid var(--line); background: var(--card); font-weight: 400; transition: border-color .2s, box-shadow .2s, transform .2s var(--spring); }
.qz-mode small { color: var(--muted); font-size: .8rem; }
.qz-mode input:checked + span { border-color: hsl(var(--h) 65% 50%); box-shadow: 0 0 0 4px hsl(var(--h) 65% 50% / .15); transform: translateY(-2px); }
.qz-mode input:focus-visible + span { outline: 2px solid var(--accent); }
.big-btn { padding: 15px 18px; font-size: 1.05rem; border-radius: 14px; }
.qz-top { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin: 4px 0 10px; }
.qz-dots { display: flex; gap: 5px; flex-wrap: wrap; }
.qz-dots i { width: 22px; height: 7px; border-radius: 4px; background: var(--line); transition: background .3s, width .3s; }
.qz-dots i.cur { width: 34px; background: hsl(var(--h) 65% 55%); animation: dot-blink 1.4s ease-in-out infinite; }
.qz-dots i.ok { background: var(--ok); }
.qz-dots i.no { background: var(--danger); }
.qz-stats { display: flex; gap: 6px; font-size: .85rem; font-weight: 700; white-space: nowrap; }
.qz-stats span { padding: 3px 9px; border-radius: 999px; background: var(--card); border: 1px solid var(--line); }
.qz-streak { color: #e05a00; border-color: #ffb36b !important; animation: heart-burst .6s var(--spring); }
.qz-stage { display: flex; align-items: flex-end; gap: 6px; margin-bottom: 12px; animation: m-rise .4s var(--spring) both; }
.qz-card { position: relative; flex: 1; padding: 12px 14px; border-radius: 18px 18px 18px 4px; background: var(--card); border: 1px solid var(--line); box-shadow: var(--shadow); }
.qz-card p { margin: 0; }
.qz-card h2 { margin: 4px 0 2px; font-size: 1.15rem; padding-right: 44px; }
.qz-timer { position: absolute; right: 10px; top: 10px; width: 40px; height: 40px; }
.qz-timer svg { width: 100%; height: 100%; transform: rotate(-90deg); }
.qz-timer circle { fill: none; stroke: var(--line); stroke-width: 3.5; }
.qz-timer .t { stroke: hsl(var(--h) 65% 50%); stroke-dasharray: 100; stroke-dashoffset: 0; stroke-linecap: round; transition: stroke-dashoffset .2s linear, stroke .3s; }
.qz-timer b { position: absolute; inset: 0; display: grid; place-items: center; font-size: .85rem; }
.qz-timer.hurry .t { stroke: var(--danger); }
.qz-timer.hurry b { color: var(--danger); animation: heart-burst 1s ease infinite; }
.qz-opts .poll-opt { padding: 13px 14px; font-size: 1rem; }
.poll-opt.right { animation: right-pop .45s var(--spring); }
.poll-opt.right .opt-l { background: var(--ok); color: #fff; }
.poll-opt.wrong { animation: prof-oops .45s ease; }
.poll-opt.wrong .opt-l { background: var(--danger); color: #fff; }
.poll-opt.dim { opacity: .5; }
@keyframes right-pop { 50% { transform: scale(1.03); } }
.quiz-ex { animation: m-rise .4s var(--spring) both; border-width: 2px; }
.quiz-ex b:first-child { font-size: 1.05rem; }
.quiz-ex.ok { background: linear-gradient(180deg, color-mix(in srgb, var(--ok) 10%, var(--card)), var(--card)); }
.quiz-ex.no { background: linear-gradient(180deg, color-mix(in srgb, var(--danger) 8%, var(--card)), var(--card)); }
.qz-others { color: var(--muted); font-size: .85rem; }
#nx { animation: m-rise .4s .1s var(--spring) both; }
.qz-ring { position: relative; width: 150px; height: 150px; margin: 6px auto 4px; }
.qz-ring svg { width: 100%; height: 100%; transform: rotate(-90deg); }
.qz-ring circle { fill: none; stroke: var(--line); stroke-width: 10; }
.qz-ring .v { stroke: hsl(calc(var(--r) * 120) 65% 48%); stroke-linecap: round; stroke-dasharray: 100; stroke-dashoffset: calc(100 - var(--r) * 100);
  animation: ring-fill 1.2s .2s cubic-bezier(.2, .8, .3, 1) backwards; }
@keyframes ring-fill { from { stroke-dashoffset: 100; } }
.qz-ring > div { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; }
.qz-ring b { font-size: 2.6rem; line-height: 1; }
.qz-ring small { color: var(--muted); }
.qz-rank { display: inline-block; margin: 4px 0 6px; padding: 6px 16px; border-radius: 999px; font-weight: 800; color: #fff;
  background: linear-gradient(135deg, #f2c14e, #f39b3c 50%, #e63950); box-shadow: 0 6px 16px rgba(230, 120, 60, .35); animation: m-pop .6s .6s var(--spring) both; }
.qz-st { display: grid; grid-template-columns: repeat(auto-fit, minmax(90px, 1fr)); gap: 8px; text-align: center; animation: m-rise .5s var(--spring) both; }
.qz-st b { display: block; font-size: 1.5rem; color: var(--accent); }
.qz-st small { color: var(--muted); font-size: .78rem; }
.qz-result .hero-cta { justify-content: center; margin: 6px 0 14px; }
.qz-review { text-align: left; }
.qz-review summary { cursor: pointer; font-weight: 700; }
.qz-rv { padding: 10px 0 8px 12px; border-left: 3px solid var(--ok); margin: 10px 0 0; }
.qz-rv.no { border-left-color: var(--danger); }
.qz-rv p { margin: 4px 0 0; }
#qz-next { text-align: left; }
@media (max-width: 420px) { .qz-modes { grid-template-columns: 1fr; } .ac-prof { width: 76px; height: 76px; } }

/* ---------- сборы, истории, потеряшки, задачи, сравнение, тест ---------- */
.fund-bar { height: 12px; border-radius: 999px; background: var(--accent-soft); overflow: hidden; margin: 10px 0 6px; }
.fund-bar i { display: block; height: 100%; border-radius: inherit; background: linear-gradient(90deg, #f4b73f, #e8743b);
  transition: width 1s cubic-bezier(.2, .8, .3, 1); }
.fund-sum { margin: 0; font-size: .92rem; color: var(--muted); }
.fund-sum b { color: var(--text); font-size: 1.05rem; }
.fund-card { display: flex; align-items: stretch; text-decoration: none; color: inherit; }
.fund-card .ph { width: 96px; flex: none; aspect-ratio: auto; font-size: 2rem; }
.fund-card .in { flex: 1; min-width: 0; }
.fund-mini { display: block; text-decoration: none; color: inherit; border-color: #f4b73f; }
.adopted { display: flex; align-items: center; gap: 14px; margin: 18px 0 10px; padding: 14px 18px; border-radius: var(--radius);
  background: linear-gradient(120deg, #dff3e7, var(--accent-soft)); color: var(--text); text-decoration: none; }
.adopted b { font-size: 2.2rem; line-height: 1; color: var(--ok); }
.story-strip { display: flex; gap: 10px; overflow-x: auto; scrollbar-width: none; margin-bottom: 12px; }
.story-chip { flex: none; width: 88px; text-align: center; text-decoration: none; color: var(--text); font-size: .82rem; }
.story-chip img { width: 88px; height: 88px; border-radius: 50%; object-fit: cover; border: 3px solid var(--ok); margin-bottom: 4px; }
.story-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 14px; }
.story-pics { display: flex; gap: 2px; }
.story-pics figure { margin: 0; flex: 1; position: relative; }
.story-pics img { width: 100%; aspect-ratio: 1; object-fit: cover; }
.story-pics figcaption { position: absolute; left: 8px; bottom: 8px; background: rgba(0, 0, 0, .55); color: #fff; font-size: .75rem;
  padding: 2px 8px; border-radius: 999px; }
.story .clamp { display: -webkit-box; -webkit-line-clamp: 6; -webkit-box-orient: vertical; overflow: hidden; }
.story-adm { display: flex; gap: 12px; padding: 12px; flex-wrap: wrap; }
.story-adm .story-pics { width: 200px; flex: none; }
.story-adm textarea { width: 100%; min-height: 90px; margin-top: 6px; }
.task .facts { margin-top: 8px; }
.facts-link { align-self: center; font-size: .85rem; }
.task-teaser { display: block; text-decoration: none; color: inherit; margin: 12px 0; border-left: 4px solid var(--ok); }
.contact-box { background: var(--accent-soft); border-radius: 12px; padding: 10px 14px; }
.dogs-tools { display: flex; flex-wrap: wrap; gap: 8px; margin: 0 0 12px; }
.cmp-wrap { overflow-x: auto; margin: 0 -16px; padding: 0 16px; }
.cmp { border-collapse: collapse; min-width: 100%; }
.cmp th, .cmp td { padding: 8px 10px; border-bottom: 1px solid var(--line); vertical-align: top; text-align: left; min-width: 140px; }
.cmp th[scope=row] { color: var(--muted); font-weight: 600; min-width: 90px; position: sticky; left: 0; background: var(--bg); }
.cmp th[scope=col] a { display: block; text-decoration: none; color: var(--text); }
.cmp th[scope=col] img { width: 120px; height: 120px; object-fit: cover; border-radius: 12px; margin-bottom: 6px; }
.cmp p { margin: 0; }
.fit-opts { display: flex; flex-direction: column; gap: 8px; }
.fit-opts .btn { text-align: left; white-space: normal; }
@media (prefers-color-scheme: dark) {
  .adopted { background: linear-gradient(120deg, #1d3427, var(--accent-soft)); }
  .adopted b { color: #7fd1a1; }
}
.story-adm .grow { flex: 1 1 260px; min-width: 0; }
@media (max-width: 520px) { .story-adm .story-pics { width: 100%; } }
.adm-sep { flex: none; width: 1px; align-self: stretch; margin: 6px 4px; background: var(--line); }
/* audit fixes 2026-11-01 */
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }
.empty h1 { font-size: 1.2rem; margin: .2rem 0; color: var(--text); }
@media (max-width: 600px) {
  .filters:has(select) { flex-wrap: wrap; overflow: visible; }
  .filters select { flex: 1 1 calc(50% - 4px); min-width: 0; }
}
.story-pics > img { flex: 1 1 0; min-width: 0; width: 50%; }
/* «Хочу взять»: step-by-step questionnaire */
.af-steps { display: flex; gap: 6px; margin: 0 0 12px; }
.af-steps span { flex: 1; height: 6px; border-radius: 999px; background: var(--accent-soft); font-size: 0; transition: background .3s; }
.af-steps span.done { background: var(--ok); }
.af-steps span.on { background: var(--accent); }
.af h2 { margin-top: 0; }
.af-group { border: 0; padding: 0; margin: 0 0 14px; }
.af-group legend { font-weight: 600; font-size: .9rem; margin-bottom: 6px; padding: 0; }
.af-pills { display: flex; flex-wrap: wrap; gap: 8px; }
.af-pill { position: relative; cursor: pointer; }
.af-pill input { position: absolute; inset: 0; opacity: 0; margin: 0; cursor: pointer; }
.af-pill span { display: inline-block; padding: 8px 14px; border-radius: 999px; border: 1px solid var(--line); background: var(--card);
  font-size: .92rem; transition: background .2s, border-color .2s, color .2s; }
.af-pill input:checked + span { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }
.af-pill input:focus-visible + span { outline: 2px solid var(--accent); outline-offset: 2px; }
.af-check { margin: 0 0 12px; }
.af-nav { display: flex; justify-content: space-between; gap: 10px; margin-top: 16px; }
.af-nav .btn { min-width: 120px; }
.af-saved { margin-top: 10px; }
.req-flags { display: flex; flex-wrap: wrap; gap: 6px; margin: 6px 0; }
.req-answers details { margin: 6px 0; }
.req-answers dl { margin: 6px 0 0; }
.my-answers { padding: 0 12px 12px; }
.my-answers summary { cursor: pointer; color: var(--accent); font-weight: 600; }
.my-answers h3 { font-size: .95rem; margin: 10px 0 4px; }
.my-answers dt { color: var(--muted); font-size: .85rem; margin-top: 6px; }
.my-answers dd { margin: 0; }
.af-stop { border-color: var(--danger); background: color-mix(in srgb, var(--danger) 8%, var(--card)); margin: -4px 0 14px; }
.af-stop p:first-child { margin-top: 0; font-weight: 600; }
