/* ProDom — дизайн-система сайта. Минимализм: тёплый фон, один фирменный цвет, мало теней и рамок. */
/* Цвета темы зарегистрированы как <color>: при смене режима они плавно перетекают друг в друга */
@property --brand { syntax: '<color>'; inherits: true; initial-value: #0E7490; }
@property --brand-ink { syntax: '<color>'; inherits: true; initial-value: #155E75; }
@property --brand-soft { syntax: '<color>'; inherits: true; initial-value: #E6F6FA; }
@property --accent { syntax: '<color>'; inherits: true; initial-value: #0891B2; }
@property --accent-2 { syntax: '<color>'; inherits: true; initial-value: #06B6D4; }
@property --chat-1 { syntax: '<color>'; inherits: true; initial-value: #D5EEF5; }
@property --chat-2 { syntax: '<color>'; inherits: true; initial-value: #E6F5F1; }
@property --chat-3 { syntax: '<color>'; inherits: true; initial-value: #DEEAF7; }
@property --wave-r { syntax: '<length>'; inherits: false; initial-value: 0px; }

:root {
  --bg: #F5F3EE;
  --surface: #FFFFFF;
  --surface-2: #FAF9F6;
  --ink: #16181B;
  --ink-2: #3A3E44;
  --muted: #6E727A;
  --line: #E7E3DA;
  --brand: #0E7490;          /* циан: кнопки и текст на белом (контраст 5.4:1) */
  --brand-ink: #155E75;
  --brand-soft: #E6F6FA;
  --accent: #0891B2;         /* яркий циан: значки, акценты */
  --accent-2: #06B6D4;
  --chat-1: #D5EEF5;
  --chat-2: #E6F5F1;
  --chat-3: #DEEAF7;
  --glass: rgba(255, 255, 255, .72);
  --glass-warm: rgba(245, 243, 238, .72);
  --blur: saturate(1.8) blur(20px);
  --ease: cubic-bezier(.22, 1, .36, 1);
  --spring: cubic-bezier(.34, 1.4, .64, 1);
  --gold: #B8902C;
  --gold-soft: #F6EFD9;
  --danger: #B93A2A;
  --danger-soft: #FBE9E6;
  --warn: #9A6A12;
  --warn-soft: #FBF1DC;
  --free: #2E9E6B;
  --busy: #D08A2E;
  --off: #B9BCC2;
  --radius: 14px;
  --radius-sm: 10px;
  --shadow: 0 1px 2px rgba(20, 22, 25, .04), 0 6px 24px rgba(20, 22, 25, .06);
  --header-h: 68px;
  --tabbar-h: 64px;
  --font: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  color-scheme: light;
}
/* Режим мастера: зелёная тема */
:root[data-theme="master"] {
  --brand: #047857;          /* изумрудный: контраст с белым 5.5:1 */
  --brand-ink: #065F46;
  --brand-soft: #E5F5EC;
  --accent: #059669;
  --accent-2: #10B981;
  --chat-1: #D8F1E3;
  --chat-2: #EAF6EE;
  --chat-3: #DDEFEA;
}
:root { transition: --brand .8s var(--ease), --brand-ink .8s var(--ease), --brand-soft .8s var(--ease), --accent .8s var(--ease), --accent-2 .8s var(--ease), --chat-1 .8s var(--ease), --chat-2 .8s var(--ease), --chat-3 .8s var(--ease); }
:root.theme-instant { transition: none; }

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
html { scroll-behavior: smooth; }
/* Обои сайта: ненавязчивый узор из инструментов (как фоны чатов в Telegram) + мягкие цветовые пятна */
body { margin: 0; overflow-x: hidden;
  background:
    radial-gradient(1100px 600px at 100% -10%, color-mix(in srgb, var(--accent-2) 10%, transparent), transparent 60%),
    radial-gradient(900px 600px at -10% 40%, color-mix(in srgb, var(--brand) 7%, transparent), transparent 60%),
    var(--bg); color: var(--ink); font: 15px/1.5 var(--font); -webkit-font-smoothing: antialiased; }
/* Узор из инструментов окрашивается в цвет текущего режима */
body::before { content: ""; position: fixed; inset: 0; z-index: -1; pointer-events: none; background: var(--brand);
  -webkit-mask: url("/assets/pattern.svg") 0 0 / 480px 480px repeat; mask: url("/assets/pattern.svg") 0 0 / 480px 480px repeat; }
a { color: inherit; text-decoration: none; }
button, input, select, textarea { font: inherit; color: inherit; }
img { max-width: 100%; display: block; }
svg:not([width]) { width: 1.1em; height: 1.1em; vertical-align: -0.18em; flex-shrink: 0; }
h1, h2, h3 { margin: 0; letter-spacing: -.02em; line-height: 1.2; }
h1 { font-size: 30px; font-weight: 750; }
h2 { font-size: 21px; font-weight: 700; }
h3 { font-size: 16px; font-weight: 650; }
p { margin: 0; }
.muted { color: var(--muted); }
.small { font-size: 13px; }
.tiny { font-size: 12px; }
.nowrap { white-space: nowrap; }
.hidden { display: none !important; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
:focus-visible { outline: 2px solid var(--brand); outline-offset: 2px; }

/* ---------- Заставка ---------- */
.splash { position: fixed; inset: 0; z-index: 1000; background: var(--brand); color: #F4F1EA; display: grid; place-items: center; transition: opacity .45s ease, visibility .45s; }
.splash.out { opacity: 0; visibility: hidden; }
.splash-inner { text-align: center; }
.splash-logo { width: 84px; height: 84px; margin: 0 auto 18px; animation: pop .7s cubic-bezier(.2, .9, .3, 1.3) both; }
.splash-logo rect { fill: #F4F1EA; } .splash-logo path:first-of-type { fill: var(--brand); } .splash-logo path:last-of-type { stroke: #F4F1EA; }
.splash-title { font-size: 34px; font-weight: 800; letter-spacing: -.03em; animation: rise .6s .25s both; }
.splash-slogan { opacity: .8; margin-top: 6px; animation: rise .6s .45s both; }
.splash-bar { width: 120px; height: 3px; border-radius: 3px; background: rgba(255,255,255,.2); margin: 26px auto 0; overflow: hidden; }
.splash-bar i { display: block; height: 100%; width: 40%; background: #F4F1EA; border-radius: 3px; animation: load 1.6s ease-in-out both; }
@keyframes pop { from { transform: scale(.6) rotate(-8deg); opacity: 0; } to { transform: none; opacity: 1; } }
@keyframes rise { from { transform: translateY(10px); opacity: 0; } to { transform: none; opacity: 1; } }
@keyframes load { from { transform: translateX(-100%); } to { transform: translateX(250%); } }

/* ---------- Шапка сайта ---------- */
.header { position: sticky; top: 0; z-index: 50; height: var(--header-h); background: var(--glass-warm); -webkit-backdrop-filter: var(--blur); backdrop-filter: var(--blur); border-bottom: 1px solid rgba(0, 0, 0, .06); }
.header { transition: box-shadow .3s var(--ease), background .3s var(--ease); }
.header.scrolled { box-shadow: 0 6px 24px rgba(10, 40, 50, .08); }
.header-in { max-width: 1240px; margin: 0 auto; height: 100%; padding: 0 24px; display: flex; align-items: center; gap: 18px; }
.brand { display: flex; align-items: center; gap: 10px; font-weight: 800; font-size: 20px; letter-spacing: -.03em; flex-shrink: 0; }
.brand img { width: 34px; height: 34px; }
.nav { display: flex; gap: 4px; margin-left: 8px; }
.nav a { padding: 8px 12px; border-radius: 10px; color: var(--ink-2); font-weight: 550; position: relative; transition: background .2s var(--ease), color .2s var(--ease); }
.nav a:hover { background: rgba(0,0,0,.04); }
.nav a.active { color: var(--brand); background: var(--brand-soft); }
.header-search { flex: 1; max-width: 420px; position: relative; }
.header-actions { display: flex; align-items: center; gap: 6px; margin-left: auto; }
.icon-btn { overflow: hidden; transition: background .2s var(--ease), transform .2s var(--ease); width: 40px; height: 40px; display: grid; place-items: center; border-radius: 12px; border: 0; background: transparent; cursor: pointer; position: relative; color: var(--ink-2); }
.icon-btn:hover { background: rgba(0,0,0,.05); }
.icon-btn svg { width: 22px; height: 22px; }
.dot.pop { animation: pop-badge .45s var(--spring); }
@keyframes pop-badge { 0% { transform: scale(.4); } 60% { transform: scale(1.25); } }
.dot { position: absolute; top: 4px; right: 4px; min-width: 18px; height: 18px; padding: 0 5px; border-radius: 9px; background: var(--danger); color: #fff; font-size: 11px; font-weight: 700; display: grid; place-items: center; border: 2px solid var(--bg); }
.nav .dot { top: -2px; right: -4px; }
.mode-chip { font-size: 12px; font-weight: 650; padding: 4px 10px; border-radius: 99px; background: var(--surface); border: 1px solid var(--line); color: var(--ink-2); cursor: pointer; }
.mode-chip b { color: var(--brand); }

/* ---------- Нижняя навигация (мобильная) ---------- */
.tabbar { display: none; }
@media (max-width: 860px) {
  .nav, .header-search, .header .hide-m { display: none !important; }
  .header-in { padding: 0 14px; gap: 10px; }
  .tabbar { display: grid; grid-template-columns: repeat(5, 1fr); position: fixed; bottom: 0; left: 0; right: 0; z-index: 60; height: calc(var(--tabbar-h) + env(safe-area-inset-bottom)); padding-bottom: env(safe-area-inset-bottom); background: var(--glass); -webkit-backdrop-filter: var(--blur); backdrop-filter: var(--blur); border-top: 1px solid rgba(0, 0, 0, .06); }
  .tabbar a { transition: color .2s var(--ease), transform .2s var(--ease); display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px; font-size: 11px; font-weight: 600; color: var(--muted); position: relative; }
  .tabbar a svg { width: 24px; height: 24px; }
  .tabbar a.active { color: var(--brand); }
  .tabbar a.active svg { animation: tab-pop .45s var(--spring); }
  @keyframes tab-pop { 40% { transform: translateY(-3px) scale(1.12); } }
  .tabbar .create { color: #fff; }
  .tabbar .create span.plus { width: 50px; height: 50px; margin-top: -18px; border-radius: 16px; background: var(--brand); display: grid; place-items: center; box-shadow: 0 6px 16px rgba(14, 116, 144, .35); }
  .tabbar .create .lbl { color: var(--brand); }
  .tabbar .dot { top: 6px; right: calc(50% - 22px); }
  main { padding-bottom: calc(var(--tabbar-h) + 24px) !important; }
  .footer { padding-bottom: calc(var(--tabbar-h) + 20px) !important; }
}

/* ---------- Макет ---------- */
main { max-width: 1240px; margin: 0 auto; padding: 28px 24px 48px; min-height: calc(100vh - var(--header-h) - 120px); }
main.narrow { max-width: 760px; }
main.wide { max-width: 1400px; }
@media (max-width: 860px) { main { padding: 18px 14px 32px; } h1 { font-size: 24px; } }
.page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 12px; margin-bottom: 20px; flex-wrap: wrap; }
.page-head p { margin-top: 4px; }
.stack { display: flex; flex-direction: column; gap: 12px; }
.stack-lg { display: flex; flex-direction: column; gap: 24px; }
.row { display: flex; align-items: center; gap: 10px; }
.row.wrap { flex-wrap: wrap; }
.row.between { justify-content: space-between; }
.grow { flex: 1; min-width: 0; }
.grid { display: grid; gap: 16px; grid-template-columns: repeat(auto-fill, minmax(270px, 1fr)); }
.grid-2 { display: grid; gap: 16px; grid-template-columns: 1fr 1fr; }
@media (max-width: 700px) { .grid-2 { grid-template-columns: 1fr; } .grid { grid-template-columns: 1fr; } }
.two-col { display: grid; grid-template-columns: minmax(0, 1fr) 340px; gap: 24px; align-items: start; }
@media (max-width: 960px) { .two-col { grid-template-columns: minmax(0, 1fr); } }
.two-col > * { min-width: 0; }
.sticky { position: sticky; top: calc(var(--header-h) + 20px); }
hr.sep { border: 0; border-top: 1px solid var(--line); margin: 4px 0; }

/* ---------- Карточки и панели ---------- */
.card { background: var(--surface); border-radius: var(--radius); border: 1px solid var(--line); }
.pad { padding: 20px; }
.pad-sm { padding: 14px; }
@media (max-width: 600px) { .pad { padding: 16px; } }
.section-title { display: flex; align-items: center; justify-content: space-between; margin-bottom: 12px; }

.listing { display: flex; flex-direction: column; overflow: hidden; transition: transform .3s var(--ease), box-shadow .3s var(--ease); cursor: pointer; }
.listing:hover { transform: translateY(-3px); box-shadow: 0 12px 32px rgba(10, 40, 50, .1); }
.listing .cover img { transition: transform .5s var(--ease), opacity .45s var(--ease); }
.listing .cover img, .gallery img, .thumbs img, .msg img, .avatar img { opacity: 0; transition: opacity .45s var(--ease), transform .5s var(--ease); }
.img-ok { opacity: 1 !important; }
.listing:active, .master-card:active, .cat-tile:active { transform: scale(.985); transition-duration: .1s; }
.listing:hover .cover img { transform: scale(1.04); }
.listing .cover { aspect-ratio: 16 / 10; background: var(--surface-2); position: relative; overflow: hidden; }
.listing .cover img { width: 100%; height: 100%; object-fit: cover; }
.listing .body { padding: 14px 16px 16px; display: flex; flex-direction: column; gap: 8px; flex: 1; }
.listing .title { font-weight: 650; font-size: 16px; line-height: 1.3; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.listing .desc { color: var(--muted); font-size: 14px; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.listing .foot { margin-top: auto; display: flex; align-items: center; justify-content: space-between; gap: 8px; padding-top: 6px; }
.price { font-weight: 750; font-size: 17px; letter-spacing: -.01em; }
.placeholder { width: 100%; height: 100%; display: grid; place-items: center; font-size: 42px; background: linear-gradient(135deg, var(--brand-soft), var(--surface-2)); }
.cover .tag-promo { position: absolute; left: 10px; top: 10px; }

.master-card { padding: 18px; display: flex; flex-direction: column; gap: 12px; cursor: pointer; transition: transform .3s var(--ease), box-shadow .3s var(--ease); }
.master-card:hover { transform: translateY(-3px); box-shadow: 0 12px 32px rgba(10, 40, 50, .1); }
/* карточки появляются по очереди */
.grid > *, .stack > .card, .cat-grid > * { animation: card-in .45s var(--ease) both; }
.grid > :nth-child(2), .cat-grid > :nth-child(2) { animation-delay: .04s; } .grid > :nth-child(3), .cat-grid > :nth-child(3) { animation-delay: .08s; }
.grid > :nth-child(4), .cat-grid > :nth-child(4) { animation-delay: .12s; } .grid > :nth-child(5), .cat-grid > :nth-child(5) { animation-delay: .16s; }
.grid > :nth-child(6), .cat-grid > :nth-child(6) { animation-delay: .2s; } .grid > :nth-child(n+7), .cat-grid > :nth-child(n+7) { animation-delay: .24s; }
@keyframes card-in { from { opacity: 0; transform: translateY(12px); } }
/* плавная смена страниц */
.page-in { animation: page-in .35s var(--ease) backwards; }
.page-out { opacity: 0; transition: opacity .12s ease; }
@keyframes page-in { from { opacity: 0; transform: translateY(8px); } }
.master-card .thumbs { display: grid; grid-template-columns: repeat(4, 1fr); gap: 6px; }
.master-card .thumbs img, .master-card .thumbs div { aspect-ratio: 1; border-radius: 8px; object-fit: cover; background: var(--surface-2); }
.svc-line { display: flex; justify-content: space-between; gap: 10px; font-size: 14px; padding: 6px 0; border-top: 1px dashed var(--line); }
.svc-line span:first-child { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* ---------- Аватар, бейджи ---------- */
.avatar { width: 44px; height: 44px; border-radius: 50%; background: var(--brand-soft); color: var(--brand-ink); display: grid; place-items: center; font-weight: 700; flex-shrink: 0; overflow: hidden; font-size: 16px; }
.avatar img { width: 100%; height: 100%; object-fit: cover; }
.avatar.sm { width: 32px; height: 32px; font-size: 13px; }
.avatar.lg { width: 96px; height: 96px; font-size: 34px; }
.avatar.online { box-shadow: 0 0 0 2px var(--surface), 0 0 0 4px var(--free); }
.name-line { display: flex; align-items: center; gap: 6px; font-weight: 650; min-width: 0; }
.name-line .nm { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.badge-verified { display: inline-flex; align-items: center; gap: 4px; color: var(--brand); font-size: 12px; font-weight: 650; white-space: nowrap; }
.badge-verified svg { width: 16px; height: 16px; flex-shrink: 0; }
.badge-pro { display: inline-block; font-size: 10.5px; font-weight: 800; letter-spacing: .06em; padding: 2px 6px; border-radius: 6px; background: var(--ink); color: #F2D78A; line-height: 1.3; }
.tag { display: inline-flex; align-items: center; gap: 4px; font-size: 12px; font-weight: 600; padding: 3px 9px; border-radius: 99px; background: var(--surface-2); color: var(--ink-2); border: 1px solid var(--line); white-space: nowrap; }
.tag-brand { background: var(--brand-soft); color: var(--brand-ink); border-color: transparent; }
.tag-promo { background: var(--gold-soft); color: #7A5C10; border-color: transparent; }
.tag-warn { background: var(--warn-soft); color: var(--warn); border-color: transparent; }
.tag-danger { background: var(--danger-soft); color: var(--danger); border-color: transparent; }
.rating { display: inline-flex; align-items: center; gap: 4px; font-weight: 700; font-size: 14px; }
.rating .star { color: var(--gold); display: inline-flex; }
.rating .star svg { width: 15px; height: 15px; }
.rating .cnt { color: var(--muted); font-weight: 500; }
.avail { display: inline-flex; align-items: center; gap: 6px; font-size: 13px; color: var(--muted); }
.avail i { width: 8px; height: 8px; border-radius: 50%; background: var(--off); }
.avail.ok i { background: var(--free); }
.avail.ok { color: var(--ink-2); }

/* ---------- Кнопки ---------- */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; height: 44px; padding: 0 18px; border-radius: 12px; border: 1px solid transparent; font-weight: 650; cursor: pointer; background: var(--ink); color: #fff; transition: background .2s var(--ease), transform .2s var(--ease), box-shadow .2s var(--ease); white-space: nowrap; text-align: center; position: relative; overflow: hidden; }
.btn:active, .chip:active, .icon-btn:active { transform: scale(.96); }
.btn-primary:hover { box-shadow: 0 6px 18px rgba(14, 116, 144, .3); }
.ripple { position: absolute; border-radius: 50%; background: currentColor; opacity: .22; transform: scale(0); pointer-events: none; animation: ripple .55s var(--ease) forwards; }
@keyframes ripple { to { transform: scale(1); opacity: 0; } }
.btn:disabled { opacity: .5; cursor: not-allowed; }
.btn-primary { background: var(--brand); }
.btn-primary:hover { background: var(--brand-ink); }
.btn-ghost { background: var(--surface); color: var(--ink); border-color: var(--line); }
.btn-ghost:hover { background: var(--surface-2); }
.btn-soft { background: var(--brand-soft); color: var(--brand-ink); }
.btn-danger { background: var(--danger-soft); color: var(--danger); }
.btn-sm { height: 34px; padding: 0 12px; font-size: 13.5px; border-radius: 10px; }
.btn-block { width: 100%; }
.btn-link { background: none; border: 0; color: var(--brand); font-weight: 600; cursor: pointer; padding: 0; }
.btn svg { width: 18px; height: 18px; }
.header .btn-create { height: 40px; }

/* ---------- Формы ---------- */
.field { display: flex; flex-direction: column; gap: 6px; }
.field > label, .label { font-size: 13px; font-weight: 650; color: var(--ink-2); }
.field .hint { font-size: 12.5px; color: var(--muted); }
.req::after { content: " *"; color: var(--danger); }
.input, select.input, textarea.input { width: 100%; height: 46px; padding: 0 14px; border-radius: 12px; border: 1px solid var(--line); background: var(--surface); outline: none; transition: border-color .15s, box-shadow .15s; }
textarea.input { height: auto; min-height: 96px; padding: 12px 14px; resize: vertical; }
.input:focus { border-color: var(--brand); box-shadow: 0 0 0 3px var(--brand-soft); }
.input.err { border-color: var(--danger); }
.search-input { padding-left: 44px; background: var(--surface) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%236E727A' stroke-width='2' stroke-linecap='round'%3E%3Ccircle cx='11' cy='11' r='7'/%3E%3Cpath d='m20 20-3.5-3.5'/%3E%3C/svg%3E") no-repeat 14px center / 20px; }
.check { display: flex; gap: 10px; align-items: flex-start; font-size: 14px; cursor: pointer; }
.check input { width: 18px; height: 18px; margin-top: 2px; accent-color: var(--brand); flex-shrink: 0; }
.seg { display: inline-flex; background: rgba(0,0,0,.05); border-radius: 12px; padding: 3px; gap: 2px; position: relative; }
.seg > button, .seg > a { border: 0; background: transparent; padding: 8px 14px; border-radius: 9px; font-weight: 600; cursor: pointer; color: var(--ink-2); font-size: 14px; position: relative; z-index: 1; transition: color .25s var(--ease); }
.seg > .on { background: var(--surface); color: var(--ink); box-shadow: 0 1px 3px rgba(0,0,0,.08); }
.seg.has-ind > .on { background: transparent; box-shadow: none; }
.nav { position: relative; }
.nav > a { z-index: 1; }
.nav.has-ind > a.active { background: transparent; }
.nav > .seg-ind { background: var(--brand-soft); box-shadow: none; top: 0; bottom: 0; border-radius: 10px; }
.tabs { position: relative; }
.tabs.has-ind > .on { border-bottom-color: transparent; }
.tabs > .seg-ind { top: auto; bottom: 0; height: 2px; border-radius: 2px; background: var(--brand); box-shadow: none; z-index: 1; }
.seg-ind { position: absolute; top: 3px; bottom: 3px; left: 0; width: 0; border-radius: 9px; background: var(--surface); box-shadow: 0 1px 4px rgba(0,0,0,.1); transition: transform .34s var(--spring), width .34s var(--spring); z-index: 0; pointer-events: none; }
.form-err { background: var(--danger-soft); color: var(--danger); padding: 10px 14px; border-radius: 10px; font-size: 14px; }
.demo-code { background: var(--warn-soft); color: var(--warn); padding: 10px 14px; border-radius: 10px; font-size: 14px; border: 1px dashed #E3C27A; }
.demo-code b { font-size: 18px; letter-spacing: .15em; color: var(--ink); }

/* загрузка фото */
.uploader { display: flex; gap: 10px; flex-wrap: wrap; }
.uploader .ph { width: 96px; height: 96px; border-radius: 12px; overflow: hidden; position: relative; background: var(--surface-2); border: 1px solid var(--line); }
.uploader .ph img { width: 100%; height: 100%; object-fit: cover; }
.uploader .ph button { position: absolute; top: 4px; right: 4px; width: 24px; height: 24px; border-radius: 50%; border: 0; background: rgba(0,0,0,.6); color: #fff; cursor: pointer; font-size: 14px; line-height: 1; }
.uploader .add { width: 96px; height: 96px; border-radius: 12px; border: 1.5px dashed #CFC9BC; display: grid; place-items: center; cursor: pointer; color: var(--muted); font-size: 13px; text-align: center; background: transparent; }
.uploader .add svg { width: 24px; height: 24px; margin-bottom: 4px; }
.uploader .add:hover { border-color: var(--brand); color: var(--brand); }

/* ---------- Главная / поиск ---------- */
.hero { background: linear-gradient(135deg, var(--brand) 0%, var(--accent) 55%, var(--accent-2) 100%); color: #F4FBFD; border-radius: 22px; padding: 34px 34px 28px; margin-bottom: 22px; position: relative; overflow: hidden; }
.hero::after { content: ""; position: absolute; right: -60px; top: -80px; width: 320px; height: 320px; border-radius: 50%; background: rgba(255,255,255,.1); animation: float 9s ease-in-out infinite; }
.hero::before { content: ""; position: absolute; left: 40%; bottom: -120px; width: 260px; height: 260px; border-radius: 50%; background: rgba(255,255,255,.07); animation: float 11s ease-in-out infinite reverse; }
@keyframes float { 50% { transform: translate(-18px, 14px) scale(1.04); } }
.hero h1 { font-size: 34px; max-width: 640px; position: relative; z-index: 1; }
.hero p { opacity: .85; margin-top: 8px; max-width: 620px; position: relative; z-index: 1; }
.hero-search { display: flex; gap: 10px; margin-top: 22px; position: relative; z-index: 1; max-width: 760px; }
.hero-search .input { height: 52px; border: 0; font-size: 16px; color: var(--ink); }
.hero-search .btn { height: 52px; background: var(--ink); box-shadow: 0 6px 18px rgba(0,0,0,.18); }
.hero-hints { margin-top: 12px; display: flex; gap: 8px; flex-wrap: wrap; position: relative; z-index: 1; }
.hero-hints button { border: 1px solid rgba(255,255,255,.3); background: rgba(255,255,255,.08); -webkit-backdrop-filter: blur(6px); backdrop-filter: blur(6px); color: #F4FBFD; transition: background .2s var(--ease), transform .2s var(--ease); border-radius: 99px; padding: 5px 12px; font-size: 13px; cursor: pointer; }
.hero-hints button:hover { background: rgba(255,255,255,.2); transform: translateY(-1px); }
@media (max-width: 600px) { .hero { padding: 22px 18px; border-radius: 18px; } .hero h1 { font-size: 24px; } .hero-search .btn { padding: 0 14px; } }
.chips { display: flex; gap: 8px; overflow-x: auto; padding-bottom: 4px; scrollbar-width: none; }
.chips::-webkit-scrollbar { display: none; }
.chip { position: relative; overflow: hidden; transition: background .2s var(--ease), color .2s var(--ease), border-color .2s var(--ease), transform .2s var(--ease); flex-shrink: 0; display: inline-flex; align-items: center; gap: 6px; padding: 8px 14px; border-radius: 99px; background: var(--surface); border: 1px solid var(--line); font-size: 14px; font-weight: 550; cursor: pointer; white-space: nowrap; }
.chip:hover { border-color: #CFC9BC; }
.chip.on { background: var(--ink); color: #fff; border-color: var(--ink); }
.search-layout > * { min-width: 0; }
.search-layout { display: grid; grid-template-columns: 260px minmax(0, 1fr); gap: 24px; align-items: start; margin-top: 18px; }
@media (max-width: 960px) { .search-layout { grid-template-columns: minmax(0, 1fr); } }
.filters-panel .field { margin-bottom: 14px; }
.results-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 14px; flex-wrap: wrap; }
.understood { font-size: 13px; color: var(--muted); }
.understood b { color: var(--brand); font-weight: 600; }

/* ---------- Категории ---------- */
.cat-grid { display: grid; gap: 12px; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); }
.cat-tile { padding: 18px; display: flex; gap: 14px; align-items: center; cursor: pointer; transition: border-color .25s var(--ease), transform .25s var(--ease), box-shadow .25s var(--ease); }
.cat-tile:hover { border-color: var(--accent); transform: translateY(-2px); box-shadow: 0 10px 26px rgba(10, 40, 50, .08); }
.cat-other { grid-column: 1 / -1; padding: 22px 24px; background: linear-gradient(120deg, #F3FBFD 0%, #FFFFFF 60%); border-style: dashed; border-color: rgba(14, 116, 144, .35); }
.cat-other .ic { background: linear-gradient(135deg, var(--accent), var(--accent-2)); color: #fff; }
@media (max-width: 600px) { .cat-other { flex-wrap: wrap; } .cat-other .nowrap { width: 100%; padding-left: 62px; } }
.cat-tile .ic { width: 48px; height: 48px; border-radius: 14px; background: var(--brand-soft); display: grid; place-items: center; font-size: 24px; flex-shrink: 0; }

/* ---------- Профиль ---------- */
.profile-head { display: flex; gap: 20px; align-items: flex-start; }
@media (max-width: 600px) { .profile-head { flex-direction: column; align-items: center; text-align: center; } .profile-head .row { justify-content: center; } }
.kpis { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.kpi { background: var(--surface-2); border-radius: 12px; padding: 12px; text-align: center; }
.kpi b { display: block; font-size: 20px; letter-spacing: -.02em; }
.kpi span { font-size: 12px; color: var(--muted); }
.gallery { display: grid; grid-template-columns: repeat(auto-fill, minmax(120px, 1fr)); gap: 8px; }
.gallery img { aspect-ratio: 1; object-fit: cover; border-radius: 10px; cursor: zoom-in; transition: opacity .45s var(--ease), transform .3s var(--ease); }
.gallery img:hover { transform: scale(1.03); }
.review { padding: 14px 0; border-top: 1px solid var(--line); }
.review:first-child { border-top: 0; }
.score { display: inline-grid; place-items: center; min-width: 40px; height: 28px; border-radius: 8px; font-weight: 800; font-size: 14px; background: var(--brand-soft); color: var(--brand-ink); }
.score.mid { background: var(--warn-soft); color: var(--warn); }
.score.low { background: var(--danger-soft); color: var(--danger); }
.tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--line); margin-bottom: 18px; overflow-x: auto; scrollbar-width: none; }
.tabs button, .tabs a { border: 0; background: none; padding: 10px 14px; font-weight: 600; color: var(--muted); cursor: pointer; border-bottom: 2px solid transparent; margin-bottom: -1px; white-space: nowrap; }
.tabs .on { color: var(--ink); border-bottom-color: var(--brand); }
.notice { padding: 12px 14px; border-radius: 12px; background: var(--surface-2); border: 1px solid var(--line); font-size: 14px; color: var(--ink-2); }
.notice.brand { background: var(--brand-soft); border-color: transparent; color: var(--brand-ink); }
.notice.warn { background: var(--warn-soft); border-color: transparent; color: var(--warn); }
.notice.danger { background: var(--danger-soft); border-color: transparent; color: var(--danger); }

/* ---------- Календарь ---------- */
.cal { user-select: none; }
.cal-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 10px; }
.cal-month { min-width: 0; }
.cal-grid { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 4px; }
.cal-dow { font-size: 11px; color: var(--muted); text-align: center; font-weight: 600; padding: 4px 0; }
.cal-day { height: 40px; border-radius: 10px; display: grid; place-items: center; font-size: 13px; font-weight: 600; background: var(--surface-2); color: var(--ink-2); border: 0; position: relative; }
.cal-day.blank { background: transparent; }
.cal-day.past { opacity: .35; }
.cal-day.free { background: #DDF2E7; color: #17603F; }
.cal-day.busy { background: #F8E6CC; color: #8A5A16; }
.cal-day.off { background: #ECEDEF; color: #8C9097; text-decoration: line-through; }
.cal-day.today::after { content: ""; position: absolute; bottom: 5px; width: 4px; height: 4px; border-radius: 50%; background: currentColor; }
.cal.editable .cal-day:not(.blank):not(.past) { cursor: pointer; }
.cal.editable .cal-day:not(.blank):not(.past):hover { outline: 2px solid var(--brand); }
.legend { display: flex; gap: 14px; flex-wrap: wrap; font-size: 12.5px; color: var(--muted); }
.legend i { display: inline-block; width: 10px; height: 10px; border-radius: 3px; margin-right: 5px; vertical-align: -1px; }

/* ---------- Чаты ---------- */
.chat-layout { display: grid; grid-template-columns: 340px minmax(0, 1fr); height: calc(100vh - var(--header-h) - 56px); min-height: 480px; overflow: hidden; }
@media (max-width: 860px) {
  .chat-layout { grid-template-columns: 1fr; height: calc(100dvh - var(--header-h) - var(--tabbar-h)); border-radius: 0; border-left: 0; border-right: 0; margin: -18px -14px 0; }
  .chat-layout.has-chat .chat-list { display: none; }
  .chat-layout:not(.has-chat) .chat-pane { display: none; }
  main.chat-main { padding-bottom: 0 !important; }
}
.chat-list { border-right: 1px solid var(--line); overflow-y: auto; }
.chat-item { display: flex; gap: 12px; padding: 14px 16px; cursor: pointer; border-bottom: 1px solid var(--line); transition: background .2s var(--ease); }
.chat-item:hover { background: var(--surface-2); }
.chat-item.on { background: var(--brand-soft); }
.chat-item .unread { min-width: 20px; height: 20px; border-radius: 10px; background: var(--brand); color: #fff; font-size: 11.5px; font-weight: 700; display: grid; place-items: center; padding: 0 6px; }
.chat-pane { display: flex; flex-direction: column; min-height: 0; min-width: 0; position: relative;
  /* обои чата в духе Telegram: мягкий циановый градиент + узор */
  background:
    linear-gradient(160deg, var(--chat-1) 0%, var(--chat-2) 45%, var(--chat-3) 100%); }
.chat-pane::before { content: ""; position: absolute; inset: 0; pointer-events: none; background: var(--brand);
  -webkit-mask: url("/assets/pattern-chat.svg") 0 0 / 480px 480px repeat; mask: url("/assets/pattern-chat.svg") 0 0 / 480px 480px repeat; }
.chat-msgs, .chat-assist, .chat-input { position: relative; }
.chat-top { position: absolute; top: 0; left: 0; right: 0; z-index: 3; display: flex; align-items: center; gap: 12px; padding: 10px 16px; background: rgba(255, 255, 255, .7); -webkit-backdrop-filter: var(--blur); backdrop-filter: var(--blur); border-bottom: 1px solid rgba(0, 0, 0, .05); }
.chat-msgs { flex: 1; overflow-y: auto; padding: 78px 16px 14px; display: flex; flex-direction: column; gap: 4px; background: transparent; scroll-behavior: smooth; }
.msg { position: relative; max-width: min(78%, 520px); padding: 8px 12px 6px; border-radius: 18px; background: #fff; align-self: flex-start; white-space: pre-wrap; word-wrap: break-word; font-size: 14.5px; box-shadow: 0 1px 1.5px rgba(10, 40, 50, .12); }
.msg.in { border-bottom-left-radius: 6px; margin-left: 6px; }
.msg.mine { align-self: flex-end; background: linear-gradient(160deg, var(--accent), var(--brand)); color: #fff; border-bottom-right-radius: 6px; margin-right: 6px; }
/* хвостики пузырей */
.msg.in:not(.photo)::after, .msg.mine:not(.photo)::after { content: ""; position: absolute; bottom: 0; width: 12px; height: 14px; }
.msg.in:not(.photo)::after { left: -6px; background: #fff; clip-path: path("M12 0 C12 8 8 12 0 14 L12 14 Z"); }
.msg.mine:not(.photo)::after { right: -6px; background: var(--brand); clip-path: path("M0 0 C0 8 4 12 12 14 L0 14 Z"); }
.msg.fresh { animation: msg-in .34s var(--spring) both; }
.msg.mine.fresh { transform-origin: bottom right; } .msg.in.fresh { transform-origin: bottom left; }
@keyframes msg-in { from { opacity: 0; transform: translateY(10px) scale(.92); } }
.msg .time { font-size: 11px; opacity: .6; margin-top: 3px; text-align: right; }
.msg img { border-radius: 10px; max-height: 280px; cursor: zoom-in; }
.msg.photo { padding: 4px; }
.msg audio { width: 240px; max-width: 100%; height: 40px; }
.msg.system { align-self: center; background: rgba(255, 255, 255, .6); -webkit-backdrop-filter: blur(8px); backdrop-filter: blur(8px); box-shadow: none; color: var(--ink-2); font-size: 12.5px; text-align: center; max-width: 90%; padding: 4px 12px; border-radius: 99px; margin: 6px 0; }
.msg.context { align-self: center; background: rgba(255, 255, 255, .75); border: 1px dashed rgba(14, 116, 144, .35); box-shadow: none; font-size: 13px; color: var(--brand-ink); border-radius: 12px; cursor: pointer; }
.msg.bot { align-self: flex-start; background: #FFFCF2; border: 1px solid #EEDFB4; max-width: min(90%, 620px); }
.msg.bot .who { font-size: 12px; font-weight: 700; color: var(--warn); margin-bottom: 4px; }
.deal-card { align-self: stretch; max-width: 520px; margin: 6px auto; background: rgba(255, 255, 255, .9); -webkit-backdrop-filter: var(--blur); backdrop-filter: var(--blur); border: 1px solid rgba(255, 255, 255, .8); border-radius: 16px; padding: 14px 16px; box-shadow: 0 4px 16px rgba(10, 40, 50, .08); }
.deal-card.fresh { animation: msg-in .38s var(--spring) both; }
.deal-card dl { display: grid; grid-template-columns: auto 1fr; gap: 4px 14px; margin: 10px 0; font-size: 14px; }
.deal-card dt { color: var(--muted); }
.deal-card dd { margin: 0; font-weight: 550; }
.chat-assist { display: flex; gap: 6px; padding: 8px 12px 0; overflow-x: auto; scrollbar-width: none; background: rgba(255, 255, 255, .72); -webkit-backdrop-filter: var(--blur); backdrop-filter: var(--blur); border-top: 1px solid rgba(0, 0, 0, .05); }
.chat-assist button { transition: border-color .2s var(--ease), color .2s var(--ease), transform .2s var(--ease); flex-shrink: 0; border: 1px solid var(--line); background: rgba(255, 255, 255, .85); border-radius: 99px; padding: 5px 11px; font-size: 12.5px; font-weight: 600; cursor: pointer; color: var(--ink-2); }
.chat-assist button:hover { border-color: var(--brand); color: var(--brand); }
.chat-input { display: flex; align-items: flex-end; gap: 8px; padding: 10px 12px; background: rgba(255, 255, 255, .72); -webkit-backdrop-filter: var(--blur); backdrop-filter: var(--blur); }
.send-btn { animation: pop-badge .35s var(--spring); }
.chat-input textarea { flex: 1; resize: none; min-height: 44px; max-height: 140px; height: 44px; padding: 11px 14px; border-radius: 22px; }
.chat-input .icon-btn { flex-shrink: 0; width: 44px; height: 44px; }
.send-btn { background: var(--brand) !important; color: #fff !important; border-radius: 50% !important; }
.rec { display: flex; align-items: center; gap: 10px; flex: 1; height: 44px; padding: 0 14px; border-radius: 22px; background: var(--danger-soft); color: var(--danger); font-weight: 650; }
.rec i { width: 10px; height: 10px; border-radius: 50%; background: var(--danger); animation: blink 1s infinite; }
@keyframes blink { 50% { opacity: .2; } }
.chat-empty { padding-top: 70px; flex: 1; display: grid; place-items: center; color: var(--muted); text-align: center; padding: 30px; }

/* ---------- Модальные окна, меню, уведомления ---------- */
.overlay { position: fixed; inset: 0; z-index: 200; background: rgba(15, 30, 38, .28); -webkit-backdrop-filter: blur(8px); backdrop-filter: blur(8px); display: grid; place-items: center; padding: 16px; animation: fade .25s var(--ease); }
.overlay.closing { animation: fade-out .2s var(--ease) forwards; }
.overlay.closing .modal { animation: modal-out .2s var(--ease) forwards; }
@keyframes fade-out { to { opacity: 0; } }
@keyframes modal-in { from { opacity: 0; transform: translateY(14px) scale(.96); } }
@keyframes modal-out { to { opacity: 0; transform: translateY(10px) scale(.97); } }
@keyframes sheet-in { from { transform: translateY(100%); } }
@keyframes sheet-out { to { transform: translateY(100%); } }
@keyframes fade { from { opacity: 0; } }
.modal { background: rgba(255, 255, 255, .94); -webkit-backdrop-filter: var(--blur); backdrop-filter: var(--blur); border-radius: 20px; width: 100%; max-width: 520px; max-height: calc(100vh - 32px); overflow-y: auto; padding: 22px; box-shadow: 0 24px 60px rgba(10, 40, 50, .22); animation: modal-in .32s var(--spring); }
.modal.lg { max-width: 760px; }
.modal-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 16px; gap: 10px; }
@media (max-width: 600px) {
  .overlay { place-items: end center; padding: 0; }
  .modal { border-radius: 22px 22px 0 0; max-height: 92vh; padding-bottom: calc(22px + env(safe-area-inset-bottom)); animation: sheet-in .38s var(--ease); }
  .modal::before { content: ""; display: block; width: 40px; height: 5px; border-radius: 3px; background: rgba(0,0,0,.15); margin: -10px auto 14px; }
  .overlay.closing .modal { animation: sheet-out .24s var(--ease) forwards; }
}
.menu { position: fixed; z-index: 210; background: rgba(255, 255, 255, .8); -webkit-backdrop-filter: var(--blur); backdrop-filter: var(--blur); border-radius: 16px; box-shadow: 0 16px 48px rgba(10, 40, 50, .2); border: 1px solid rgba(255, 255, 255, .6); min-width: 260px; padding: 6px; transform-origin: top right; animation: menu-in .26s var(--spring); }
.menu.closing { animation: menu-out .16s var(--ease) forwards; }
@keyframes menu-in { from { opacity: 0; transform: scale(.88) translateY(-6px); } }
@keyframes menu-out { to { opacity: 0; transform: scale(.94) translateY(-4px); } }
.menu a, .menu button { display: flex; align-items: center; gap: 10px; width: 100%; text-align: left; padding: 10px 12px; border: 0; background: none; border-radius: 9px; cursor: pointer; font-size: 14.5px; font-weight: 550; }
.menu a:hover, .menu button:hover { background: rgba(14, 116, 144, .08); }
.menu .menu-sep { height: 1px; background: var(--line); margin: 6px 4px; }
.menu .menu-label { padding: 8px 12px 4px; font-size: 12px; color: var(--muted); font-weight: 600; }
.menu .mode-switch { display: grid; grid-template-columns: 1fr 1fr; gap: 4px; padding: 4px 6px 6px; }
.menu .mode-switch button { justify-content: center; border: 1px solid var(--line); }
.menu .mode-switch button.on { background: var(--brand); color: #fff; border-color: var(--brand); }
.toasts { position: fixed; z-index: 300; left: 50%; transform: translateX(-50%); bottom: 24px; display: flex; flex-direction: column; gap: 8px; align-items: center; pointer-events: none; }
@media (max-width: 860px) { .toasts { bottom: calc(var(--tabbar-h) + 16px); } }
.toast { background: rgba(22, 24, 27, .82); -webkit-backdrop-filter: var(--blur); backdrop-filter: var(--blur); color: #fff; padding: 11px 16px; border-radius: 14px; font-size: 14px; box-shadow: 0 10px 30px rgba(0,0,0,.18); animation: toast-in .35s var(--spring); max-width: 92vw; pointer-events: auto; }
.toast.closing { animation: fade-out .25s var(--ease) forwards; }
@keyframes toast-in { from { opacity: 0; transform: translateY(16px) scale(.95); } }
.toast.err { background: rgba(185, 58, 42, .9); }
.toast.ok { background: color-mix(in srgb, var(--brand) 90%, transparent); }
.lightbox { position: fixed; inset: 0; z-index: 400; background: rgba(5, 15, 20, .82); -webkit-backdrop-filter: blur(14px); backdrop-filter: blur(14px); display: grid; place-items: center; cursor: zoom-out; animation: fade .25s var(--ease); }
.lightbox img { max-width: 94vw; max-height: 92vh; border-radius: 10px; animation: modal-in .35s var(--spring); }
.notif { display: flex; gap: 12px; padding: 14px 16px; border-bottom: 1px solid var(--line); cursor: pointer; }
.notif.unread { background: var(--brand-soft); }
.notif:hover { background: var(--surface-2); }

.empty { text-align: center; padding: 48px 20px; color: var(--muted); }
.empty .ic { font-size: 40px; margin-bottom: 10px; }
.empty h3 { color: var(--ink); margin-bottom: 6px; }
.skeleton { background: linear-gradient(90deg, #EEEBE4 25%, #F6F4EF 50%, #EEEBE4 75%); background-size: 200% 100%; animation: sk 1.2s infinite; border-radius: var(--radius); }
@keyframes sk { to { background-position: -200% 0; } }
.spinner { width: 22px; height: 22px; border-radius: 50%; border: 2.5px solid var(--line); border-top-color: var(--brand); animation: spin .7s linear infinite; margin: 40px auto; }
@keyframes spin { to { transform: rotate(360deg); } }
.pager { display: flex; justify-content: center; gap: 6px; margin-top: 22px; }

/* ---------- PRO ---------- */
.pro-hero { background: var(--ink); color: #F4F1EA; border-radius: 22px; padding: 34px; position: relative; overflow: hidden; }
.pro-hero .badge-pro { font-size: 14px; padding: 4px 10px; }
.pro-hero h1 { margin-top: 14px; }
.pro-hero p { opacity: .75; margin-top: 8px; max-width: 560px; }
.plans { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 12px; }
.plan { padding: 20px; cursor: pointer; border: 2px solid var(--line); transition: border-color .15s; }
.plan.on { border-color: var(--brand); background: #F7FCFD; }
.plan .p { font-size: 26px; font-weight: 800; letter-spacing: -.02em; margin: 6px 0 2px; }
.feature { display: flex; gap: 12px; align-items: flex-start; }
.feature .ic { width: 36px; height: 36px; border-radius: 10px; background: var(--gold-soft); display: grid; place-items: center; flex-shrink: 0; }
.test-banner { background: repeating-linear-gradient(45deg, #FFF6DC, #FFF6DC 12px, #FCEFC7 12px, #FCEFC7 24px); border: 1px solid #EBD18A; color: #6E4F05; padding: 14px 16px; border-radius: 12px; font-weight: 600; }
table.tbl { width: 100%; border-collapse: collapse; font-size: 14px; }
table.tbl th { text-align: left; font-size: 12px; color: var(--muted); font-weight: 600; padding: 8px 10px; border-bottom: 1px solid var(--line); white-space: nowrap; }
table.tbl td { padding: 10px; border-bottom: 1px solid var(--line); vertical-align: top; }
.tbl-wrap { overflow-x: auto; }

/* ---------- Подвал ---------- */
.footer { border-top: 1px solid var(--line); padding: 28px 24px; color: var(--muted); font-size: 13px; }
.footer-in { max-width: 1240px; margin: 0 auto; display: flex; gap: 20px; flex-wrap: wrap; justify-content: space-between; }
.footer a:hover { color: var(--ink); }
.footer .links { display: flex; gap: 16px; flex-wrap: wrap; }
.legal-doc { line-height: 1.65; }
.legal-doc h2 { margin: 24px 0 8px; font-size: 18px; }
.legal-doc p, .legal-doc li { color: var(--ink-2); margin-bottom: 8px; }

/* ---------- Запасной вариант без размытия (старые и слабые устройства) ---------- */
@supports not ((backdrop-filter: blur(1px)) or (-webkit-backdrop-filter: blur(1px))) {
  .header { background: rgba(245, 243, 238, .97); }
  .tabbar, .chat-top, .chat-input, .chat-assist, .menu, .modal { background: rgba(255, 255, 255, .97); }
  .overlay { background: rgba(15, 30, 38, .45); }
}
@media (prefers-reduced-transparency: reduce) {
  .header { background: var(--bg); } .tabbar, .chat-top, .chat-input, .chat-assist, .menu, .modal { background: #fff; }
  .header, .tabbar, .chat-top, .chat-input, .chat-assist, .menu, .modal, .overlay, .toast { -webkit-backdrop-filter: none; backdrop-filter: none; }
}
/* ---------- Пользователь просит меньше движения: отключаем анимации ---------- */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; scroll-behavior: auto !important; }
}

/* ======================================================================
   МОБИЛЬНАЯ ВЕРСИЯ: удобство на телефоне
   ====================================================================== */
* { -webkit-tap-highlight-color: transparent; }
a, button, label, .chip, .listing, .master-card, .cat-tile { touch-action: manipulation; }
.only-m { display: none !important; }
.mobile-cta { display: none; }
.filters-backdrop { display: none; }
.filters-actions { display: none; }

@media (max-width: 960px) {
  /* Фильтры — выезжающая снизу шторка */
  .filters-panel { display: block !important; position: fixed; left: 0; right: 0; bottom: 0; z-index: 230; max-height: 86vh; overflow-y: auto; border-radius: 22px 22px 0 0;
    padding-bottom: calc(96px + env(safe-area-inset-bottom)); transform: translateY(105%); transition: transform .4s var(--ease); box-shadow: 0 -10px 40px rgba(10, 40, 50, .18); animation: none !important; }
  .filters-panel.open { transform: none; }
  .filters-panel::before { content: ""; display: block; width: 40px; height: 5px; border-radius: 3px; background: rgba(0,0,0,.15); margin: -6px auto 12px; }
  .filters-backdrop { display: block; position: fixed; inset: 0; z-index: 225; background: rgba(15, 30, 38, .3); -webkit-backdrop-filter: blur(6px); backdrop-filter: blur(6px); opacity: 0; pointer-events: none; transition: opacity .3s var(--ease); }
  .filters-backdrop.open { opacity: 1; pointer-events: auto; }
  .filters-actions { display: flex; gap: 10px; position: fixed; left: 0; right: 0; bottom: 0; padding: 12px 16px calc(12px + env(safe-area-inset-bottom)); background: rgba(255,255,255,.92); -webkit-backdrop-filter: var(--blur); backdrop-filter: var(--blur); border-top: 1px solid var(--line); z-index: 231; transform: translateY(110%); transition: transform .4s var(--ease); }
  .filters-panel.open ~ .filters-actions, .filters-actions.open { transform: none; }
  .only-m { display: inline-flex !important; }
  .filter-count { min-width: 20px; height: 20px; border-radius: 10px; background: var(--brand); color: #fff; font-size: 11.5px; font-weight: 700; display: inline-grid; place-items: center; padding: 0 6px; }
}

@media (max-width: 860px) {
  /* iOS не будет увеличивать страницу при вводе: шрифт полей 16px */
  .input, select.input, textarea.input, .chat-input textarea { font-size: 16px; }
  .btn { min-height: 44px; }
  .btn-sm { min-height: 38px; }
  .icon-btn { width: 44px; height: 44px; }

  /* Шапка: место под «назад», вырез экрана в режиме приложения */
  .header { height: calc(var(--header-h) + env(safe-area-inset-top)); padding-top: env(safe-area-inset-top); }
  .brand.compact span.brand-name { display: none; }

  /* Главная: компактный баннер, результаты видны сразу */
  .hero { padding: 18px 16px 16px; margin-bottom: 14px; border-radius: 20px; }
  .hero h1 { font-size: 21px; }
  .hero p { display: none; }
  .hero-search { margin-top: 14px; }
  .hero-search .input, .hero-search .btn { height: 48px; }
  .hero-hints { flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none; margin: 12px -16px 0; padding: 0 16px; }
  .hero-hints::-webkit-scrollbar { display: none; }
  .hero-hints button { flex-shrink: 0; }
  .search-layout { margin-top: 12px; }
  .results-head { margin-bottom: 10px; }
  #sort { max-width: 52%; }

  /* Карточки компактнее: фото ниже */
  .listing .cover { aspect-ratio: 16 / 8; }
  .grid { gap: 12px; }

  /* Кабинет и профиль */
  .page-head .avatar.lg { width: 60px; height: 60px; font-size: 22px; }
  .profile-head .avatar.lg { width: 84px; height: 84px; }
  .kpis { gap: 6px; } .kpi { padding: 10px 6px; }

  /* Галерея листается пальцем */
  .gallery.swipe { display: flex; overflow-x: auto; scroll-snap-type: x mandatory; gap: 8px; margin: 0 -16px; padding: 0 16px; scrollbar-width: none; }
  .gallery.swipe::-webkit-scrollbar { display: none; }
  .gallery.swipe img { flex: 0 0 82%; aspect-ratio: 4 / 3; scroll-snap-align: center; border-radius: 14px; }

  /* Липкая кнопка действия (Написать мастеру и т. п.) над нижней панелью */
  .mobile-cta { display: flex; gap: 8px; position: fixed; left: 10px; right: 10px; bottom: calc(var(--tabbar-h) + env(safe-area-inset-bottom) + 10px); z-index: 55;
    padding: 8px; border-radius: 18px; background: rgba(255, 255, 255, .78); -webkit-backdrop-filter: var(--blur); backdrop-filter: var(--blur); box-shadow: 0 10px 30px rgba(10, 40, 50, .16);
    animation: cta-in .45s var(--spring) .15s both; transition: transform .3s var(--ease), opacity .3s var(--ease); }
  .mobile-cta .btn { flex: 1; height: 48px; }
  .mobile-cta .btn.icon-only { flex: 0 0 48px; padding: 0; }
  @keyframes cta-in { from { transform: translateY(30px); opacity: 0; } }
  main.has-cta { padding-bottom: calc(var(--tabbar-h) + 100px) !important; }

  /* Клавиатура открыта — прячем нижние панели, чтобы не закрывали поле ввода */
  body.kbd .tabbar, body.kbd .mobile-cta { transform: translateY(150%); opacity: 0; pointer-events: none; }
  .tabbar { transition: transform .25s var(--ease), opacity .25s var(--ease); }

  /* Открытый чат — на весь экран, как в Telegram */
  body.in-chat .header, body.in-chat .tabbar, body.in-chat .footer { display: none !important; }
  body.in-chat main.chat-main { padding: 0 !important; max-width: none; }
  body.in-chat .chat-layout { position: fixed; inset: 0; height: auto; margin: 0; border: 0; border-radius: 0; z-index: 40; }
  body.in-chat .chat-top { padding-top: calc(10px + env(safe-area-inset-top)); }
  body.in-chat .chat-msgs { padding-top: calc(78px + env(safe-area-inset-top)); }
  .chat-input { padding-bottom: calc(10px + env(safe-area-inset-bottom)); }
  .msg { max-width: 84%; }
  .deal-card { margin: 6px 0; }
}
.only-m.hidden { display: none !important; }

.chat-top .grow > div { min-width: 0; }
.chat-top .muted.tiny { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

/* ---------- Волна при смене режима (матовое стекло расходится от кнопки) ---------- */
.mode-wave { position: fixed; inset: 0; z-index: 9999; pointer-events: none;
  -webkit-backdrop-filter: blur(16px) saturate(1.9); backdrop-filter: blur(16px) saturate(1.9);
  background: radial-gradient(circle at var(--x) var(--y),
    transparent calc(var(--wave-r) - 120px),
    color-mix(in srgb, var(--accent-2) 24%, transparent) calc(var(--wave-r) - 40px),
    rgba(255, 255, 255, .55) calc(var(--wave-r) - 4px),
    transparent calc(var(--wave-r) + 24px));
  -webkit-mask-image: radial-gradient(circle at var(--x) var(--y), transparent calc(var(--wave-r) - 150px), #000 calc(var(--wave-r) - 50px), #000 var(--wave-r), transparent calc(var(--wave-r) + 36px));
  mask-image: radial-gradient(circle at var(--x) var(--y), transparent calc(var(--wave-r) - 150px), #000 calc(var(--wave-r) - 50px), #000 var(--wave-r), transparent calc(var(--wave-r) + 36px));
  animation: mode-wave 1.35s cubic-bezier(.42, .1, .25, 1) forwards; }
@keyframes mode-wave { from { --wave-r: 0px; } to { --wave-r: 170vmax; } }
.mode-badge { position: fixed; z-index: 10000; left: 50%; top: 42%; transform: translate(-50%, -50%); pointer-events: none;
  padding: 14px 22px; border-radius: 18px; font-weight: 750; font-size: 17px; color: #fff; white-space: nowrap;
  background: color-mix(in srgb, var(--brand) 82%, transparent); -webkit-backdrop-filter: var(--blur); backdrop-filter: var(--blur);
  box-shadow: 0 16px 40px rgba(0, 0, 0, .18); animation: mode-badge 1.2s var(--ease) forwards; }
@keyframes mode-badge { 0% { opacity: 0; transform: translate(-50%, -40%) scale(.9); } 20% { opacity: 1; transform: translate(-50%, -50%) scale(1); } 75% { opacity: 1; } 100% { opacity: 0; transform: translate(-50%, -58%) scale(.98); } }
@media (prefers-reduced-motion: reduce) { .mode-wave, .mode-badge { display: none; } }

.create-choice { gap: 12px; transition: transform .25s var(--ease), box-shadow .25s var(--ease), border-color .25s var(--ease); }
.create-choice:hover { transform: translateY(-2px); border-color: var(--accent); box-shadow: 0 12px 30px rgba(10, 40, 50, .08); }
.choice-ic { width: 52px; height: 52px; border-radius: 16px; background: var(--brand-soft); display: grid; place-items: center; font-size: 26px; }
/* Плюс на кнопке «Создать» всегда белый, даже когда вкладка активна */
.tabbar a.create.active { color: #fff; }
.tabbar a.create .lbl { color: var(--brand); }
