:root {
  --green: #22c55e;
  --green-600: #16a34a;
  --green-50: #ecfdf3;
  --green-100: #d1fadf;
  --ink: #0b0f0d;
  --ink-2: #1a201d;
  --text: #111827;
  --muted: #6b7280;
  --line: #e7ebe9;
  --bg: #f6f8f7;
  --card: #ffffff;
  --amber: #f59e0b;
  --red: #ef4444;
  --blue: #3b82f6;
  --radius: 20px;
  --radius-sm: 14px;
  --shadow: 0 1px 2px rgba(16, 24, 20, .04), 0 8px 24px rgba(16, 24, 20, .06);
  --shadow-lg: 0 24px 60px rgba(16, 24, 20, .18);
  --top-h: 64px;
  font-family: 'Onest', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
  color: var(--text);
  -webkit-font-smoothing: antialiased;
}

* { box-sizing: border-box; }
html, body { margin: 0; }
body { background: var(--bg); min-height: 100vh; }
a { color: inherit; text-decoration: none; }
button { font: inherit; color: inherit; cursor: pointer; border: 0; background: none; }
input, textarea, select { font: inherit; color: inherit; }
img { max-width: 100%; display: block; }
svg { width: 1.1em; height: 1.1em; flex: none; } /* базовий розмір інлайн-іконок; компоненти перевизначають */
h1, h2, h3, h4 { margin: 0; letter-spacing: -.02em; }
p { margin: 0; }
.hidden { display: none !important; }

/* ---------- Layout ---------- */
.app { min-height: calc(100vh - var(--top-h)); padding-bottom: 96px; }
.wrap { max-width: 1120px; margin: 0 auto; padding-left: max(20px, env(safe-area-inset-left, 0px)); padding-right: max(20px, env(safe-area-inset-right, 0px)); }
.narrow { max-width: 720px; margin: 0 auto; padding-block: 24px; padding-left: max(16px, env(safe-area-inset-left, 0px)); padding-right: max(16px, env(safe-area-inset-right, 0px)); }
.page-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin: 8px 0 20px; }
.page-head h1 { font-size: clamp(26px, 4vw, 34px); font-weight: 800; }
.stack { display: grid; gap: 12px; }
.row { display: flex; align-items: center; gap: 10px; }
.between { justify-content: space-between; }
.wrap-row { flex-wrap: wrap; }
.grow { flex: 1; min-width: 0; }
.muted { color: var(--muted); }
.small { font-size: 13px; }
.center { text-align: center; }
.mt { margin-top: 16px; } .mt-l { margin-top: 28px; }

/* ---------- Topbar ---------- */
.topbar {
  position: sticky; top: env(safe-area-inset-top, 0px); z-index: 30; height: var(--top-h);
  display: flex; align-items: center; gap: 16px; padding: 0 20px;
  background: rgba(255, 255, 255, .82); backdrop-filter: saturate(1.6) blur(16px);
  border-bottom: 1px solid rgba(0, 0, 0, .05);
}
.topbar.dark { background: rgba(11, 15, 13, .82); color: #fff; border-color: rgba(255, 255, 255, .06); }
.logo { display: flex; align-items: center; gap: 9px; font-weight: 800; font-size: 20px; letter-spacing: -.03em; }
.logo-mark { width: 30px; height: 30px; border-radius: 9px; background: var(--green); display: grid; place-items: center; }
.logo-mark svg { width: 18px; height: 18px; }
.nav { display: flex; gap: 4px; margin-left: 12px; }
.nav a { padding: 8px 14px; border-radius: 999px; font-weight: 600; font-size: 15px; color: var(--muted); }
.topbar.dark .nav a { color: rgba(255, 255, 255, .65); }
.nav a.active, .nav a:hover { color: var(--text); background: rgba(0, 0, 0, .05); }
.topbar.dark .nav a.active, .topbar.dark .nav a:hover { color: #fff; background: rgba(255, 255, 255, .08); }
.topbar .spacer { flex: 1; }

/* ---------- Bottom tab bar (mobile) ---------- */
.tabbar {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 30; display: none;
  padding: 8px 12px calc(8px + env(safe-area-inset-bottom));
  background: rgba(255, 255, 255, .92); backdrop-filter: blur(16px); border-top: 1px solid var(--line);
}
.tabbar a { flex: 1; display: grid; justify-items: center; gap: 3px; font-size: 11px; font-weight: 600; color: var(--muted); padding: 4px 0; }
.tabbar a svg { width: 24px; height: 24px; }
.tabbar a.active { color: var(--green-600); }
.tabbar .fab { margin-top: -22px; }
.tabbar .fab span.ic { width: 52px; height: 52px; border-radius: 18px; background: var(--green); color: #fff; display: grid; place-items: center; box-shadow: 0 8px 20px rgba(34, 197, 94, .45); }

@media (max-width: 760px) {
  .nav, .hide-m { display: none !important; }
  .tabbar:not(:empty) { display: flex; }
  .topbar { padding: 0 16px; }
  .wrap { padding: 0 16px; }
}
@media (min-width: 761px) { .show-m { display: none !important; } }

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  height: 48px; padding: 0 22px; border-radius: 999px; font-weight: 700; font-size: 16px;
  background: var(--ink); color: #fff; transition: transform .12s ease, background .2s, box-shadow .2s; white-space: nowrap;
}
.btn svg { width: 20px; height: 20px; flex: none; }
.btn:active { transform: scale(.97); }
.btn:disabled { opacity: .5; cursor: not-allowed; }
.btn.green { background: var(--green); color: #fff; box-shadow: 0 6px 18px rgba(34, 197, 94, .35); }
.btn.green:hover { background: var(--green-600); }
.btn.ghost { background: rgba(0, 0, 0, .05); color: var(--text); }
.btn.ghost:hover { background: rgba(0, 0, 0, .08); }
.btn.light { background: #fff; color: var(--ink); }
.btn.outline { background: transparent; color: var(--text); box-shadow: inset 0 0 0 1.5px var(--line); }
.btn.danger { background: #fff1f1; color: var(--red); }
.btn.sm { height: 38px; padding: 0 16px; font-size: 14px; }
.btn.lg { height: 58px; padding: 0 30px; font-size: 17px; }
.btn.block { width: 100%; }
.icon-btn { width: 42px; height: 42px; border-radius: 50%; display: grid; place-items: center; background: rgba(0, 0, 0, .05); flex: none; }
.icon-btn svg { width: 20px; height: 20px; }

/* ---------- Cards ---------- */
.card { background: var(--card); border-radius: var(--radius); box-shadow: var(--shadow); padding: 20px; }
.card.flat { box-shadow: none; border: 1px solid var(--line); }
.card.tap { transition: transform .15s ease, box-shadow .2s; }
.card.tap:hover { transform: translateY(-2px); box-shadow: 0 2px 4px rgba(16, 24, 20, .05), 0 16px 36px rgba(16, 24, 20, .1); }
.card h3 { font-size: 18px; font-weight: 700; }
.section-title { font-size: 13px; font-weight: 700; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); margin: 26px 4px 10px; }
.day-head { font-size: 14px; font-weight: 800; margin: 16px 4px 8px; }
.visit-time { display: flex; flex-direction: column; align-items: center; min-width: 52px; font-variant-numeric: tabular-nums; }
.visit-time small { color: var(--muted); font-size: 12px; }

/* ---------- Pills / chips / badges ---------- */
.chip { display: inline-flex; align-items: center; gap: 6px; height: 30px; padding: 0 12px; border-radius: 999px; font-size: 13px; font-weight: 600; background: #f1f4f2; color: #374151; }
.chip.green { background: var(--green-50); color: var(--green-600); }
.chip.amber { background: #fff7e6; color: #b45309; }
.chip.blue { background: #eef4ff; color: #1d4ed8; }
.chip.red { background: #fff1f1; color: #b91c1c; }
.chip.dark { background: var(--ink); color: #fff; }
.chips { display: flex; flex-wrap: wrap; gap: 6px; }
.dot { width: 8px; height: 8px; border-radius: 50%; background: currentColor; }
.badge-new { background: var(--green); color: #fff; font-size: 11px; font-weight: 800; padding: 3px 8px; border-radius: 999px; letter-spacing: .03em; }

/* ---------- Forms ---------- */
.field { display: grid; gap: 7px; }
.field > span { font-size: 14px; font-weight: 600; color: #374151; }
.input, .select, .textarea {
  width: 100%; height: 54px; padding: 0 16px; border-radius: var(--radius-sm); border: 1.5px solid transparent;
  background: #f1f4f2; font-size: 16px; outline: none; transition: border-color .15s, background .15s, box-shadow .15s;
}
.textarea { height: auto; min-height: 130px; padding: 14px 16px; resize: vertical; line-height: 1.5; }
.input:focus, .select:focus, .textarea:focus { background: #fff; border-color: var(--green); box-shadow: 0 0 0 4px rgba(34, 197, 94, .14); }
.select { appearance: none; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='20' height='20' fill='none' stroke='%236b7280' stroke-width='2'%3E%3Cpath d='m5 8 5 5 5-5'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 14px center; padding-right: 42px; }
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
@media (max-width: 520px) { .grid-2 { grid-template-columns: 1fr; } }
.hint { font-size: 13px; color: var(--muted); }
.check { display: flex; align-items: center; gap: 12px; padding: 14px 16px; border-radius: var(--radius-sm); background: #f1f4f2; cursor: pointer; font-weight: 600; }
.check input { width: 20px; height: 20px; accent-color: var(--green); }

/* Segmented control */
.seg { display: flex; padding: 4px; background: #eceff0; border-radius: 999px; gap: 2px; overflow-x: auto; scrollbar-width: none; }
.seg button { flex: 1; height: 40px; padding: 0 14px; border-radius: 999px; font-weight: 600; font-size: 14px; color: var(--muted); white-space: nowrap; }
.seg button.on { background: #fff; color: var(--text); box-shadow: 0 2px 8px rgba(0, 0, 0, .08); }

/* Option tiles (wizard) */
.tiles { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 10px; }
.tile {
  display: grid; gap: 10px; align-content: start; padding: 16px; border-radius: 18px; background: #fff; text-align: left;
  box-shadow: inset 0 0 0 1.5px var(--line); transition: box-shadow .15s, transform .12s, background .15s; font-weight: 600; font-size: 15px;
}
.tile:hover { box-shadow: inset 0 0 0 1.5px #cfd6d2; }
.tile:active { transform: scale(.98); }
.tile.on { box-shadow: inset 0 0 0 2px var(--green); background: var(--green-50); }
.tile { hyphens: auto; overflow-wrap: anywhere; }
.tile .emoji { width: 44px; height: 44px; border-radius: 14px; background: #f1f4f2; display: grid; place-items: center; font-size: 24px; }
.tile.on .emoji { background: #fff; }
.tile small { font-weight: 500; color: var(--muted); font-size: 13px; }
.pills { display: grid; grid-template-columns: repeat(auto-fill, minmax(130px, 1fr)); gap: 10px; }

/* ---------- Hero / landing ---------- */
.hero { background: radial-gradient(1200px 600px at 85% -10%, rgba(34, 197, 94, .28), transparent 60%), var(--ink); color: #fff; overflow: hidden; margin-top: calc(-1 * var(--top-h)); padding-top: var(--top-h); }
.hero-inner { display: grid; grid-template-columns: 1.1fr .9fr; gap: 48px; align-items: center; padding: 72px 20px 96px; }
.hero h1 { font-size: clamp(40px, 6.4vw, 74px); line-height: .98; font-weight: 800; letter-spacing: -.045em; }
.hero h1 em { font-style: normal; color: var(--green); }
.hero .lead { font-size: clamp(17px, 2vw, 20px); color: rgba(255, 255, 255, .7); margin-top: 22px; max-width: 520px; line-height: 1.5; }
.search {
  margin-top: 34px; display: flex; gap: 8px; padding: 8px; border-radius: 999px; background: #fff; max-width: 560px; box-shadow: var(--shadow-lg);
}
.search input { flex: 1; min-width: 0; border: 0; outline: 0; padding: 0 18px; font-size: 17px; color: var(--text); background: transparent; }
.hero .chips { margin-top: 18px; }
.hero .chip { background: rgba(255, 255, 255, .08); color: rgba(255, 255, 255, .85); height: 36px; padding: 0 14px; font-size: 14px; transition: background .15s; }
.hero .chip:hover { background: rgba(255, 255, 255, .16); }
.hero-stats { display: flex; gap: 36px; margin-top: 44px; }
.hero-stats b { display: block; font-size: 30px; font-weight: 800; letter-spacing: -.03em; }
.hero-stats span { color: rgba(255, 255, 255, .55); font-size: 14px; }

.phone {
  position: relative; width: min(340px, 100%); margin: 0 auto; aspect-ratio: 9 / 18.5; border-radius: 46px; padding: 12px;
  background: linear-gradient(145deg, #2a312d, #121614); box-shadow: 0 40px 100px rgba(0, 0, 0, .55), inset 0 0 0 1.5px rgba(255, 255, 255, .08);
}
.phone-screen { height: 100%; border-radius: 36px; background: var(--bg); color: var(--text); overflow: hidden; padding: 46px 14px 14px; position: relative; }
.phone-screen::before { content: ''; position: absolute; top: 12px; left: 50%; transform: translateX(-50%); width: 96px; height: 26px; border-radius: 999px; background: #0b0f0d; }
.phone .mini-title { font-weight: 800; font-size: 19px; letter-spacing: -.02em; }
.phone .mini { background: #fff; border-radius: 18px; padding: 12px; box-shadow: var(--shadow); display: flex; gap: 10px; align-items: center; opacity: 0; transform: translateY(16px); animation: slideIn .6s cubic-bezier(.2, .8, .2, 1) forwards; }
.phone .mini:nth-child(2) { animation-delay: .9s; } .phone .mini:nth-child(3) { animation-delay: 1.8s; } .phone .mini:nth-child(4) { animation-delay: 2.7s; }
.phone .mini b { font-size: 14px; } .phone .mini .muted { font-size: 12px; }
.phone .mini .price { margin-left: auto; font-weight: 800; font-size: 15px; white-space: nowrap; }
@keyframes slideIn { to { opacity: 1; transform: none; } }

.section { padding: 80px 0; }
.section h2 { font-size: clamp(30px, 4.4vw, 48px); font-weight: 800; letter-spacing: -.04em; line-height: 1.05; }
.section .sub { color: var(--muted); font-size: 18px; margin-top: 12px; max-width: 560px; line-height: 1.5; }
.steps { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; margin-top: 40px; }
.step { background: #fff; border-radius: 28px; padding: 28px; box-shadow: var(--shadow); }
.step .num { width: 44px; height: 44px; border-radius: 14px; background: var(--green-50); color: var(--green-600); font-weight: 800; display: grid; place-items: center; font-size: 18px; }
.step h3 { margin-top: 20px; font-size: 21px; font-weight: 700; }
.step p { margin-top: 8px; color: var(--muted); line-height: 1.5; }
.cat-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); gap: 12px; margin-top: 36px; }
.cat { background: #fff; border-radius: 22px; padding: 20px; display: grid; gap: 14px; box-shadow: var(--shadow); font-weight: 700; transition: transform .15s; }
.cat:hover { transform: translateY(-3px); }
.cat .emoji { font-size: 30px; width: 56px; height: 56px; border-radius: 18px; background: var(--bg); display: grid; place-items: center; }
.features { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; margin-top: 40px; }
.feature { padding: 24px; border-radius: 24px; background: #fff; box-shadow: var(--shadow); }
.feature .ic { width: 44px; height: 44px; border-radius: 14px; display: grid; place-items: center; background: var(--ink); color: var(--green); }
.feature .ic svg { width: 22px; height: 22px; }
.feature h3 { margin-top: 16px; font-size: 17px; }
.feature p { margin-top: 6px; color: var(--muted); font-size: 14px; line-height: 1.5; }
.pro { background: var(--ink); color: #fff; border-radius: 36px; padding: 56px; display: grid; grid-template-columns: 1.2fr .8fr; gap: 32px; align-items: center; position: relative; overflow: hidden; }
.pro::after { content: ''; position: absolute; width: 520px; height: 520px; right: -160px; top: -200px; background: radial-gradient(circle, rgba(34, 197, 94, .35), transparent 65%); }
.pro .sub { color: rgba(255, 255, 255, .65); }
.pro ul { list-style: none; padding: 0; margin: 0; display: grid; gap: 14px; position: relative; z-index: 1; }
.pro li { display: flex; gap: 12px; align-items: center; font-weight: 600; }
.pro li span { width: 28px; height: 28px; border-radius: 50%; background: rgba(34, 197, 94, .18); color: var(--green); display: grid; place-items: center; flex: none; }
.footer { padding: 40px 0 60px; color: var(--muted); font-size: 14px; }

@media (max-width: 900px) {
  .hero-inner { grid-template-columns: minmax(0, 1fr); padding: 40px 16px 64px; gap: 40px; }
  .phone { width: 280px; }
  .steps, .features { grid-template-columns: 1fr 1fr; }
  .pro { grid-template-columns: 1fr; padding: 36px 24px; border-radius: 28px; }
}
@media (max-width: 560px) {
  .steps, .features { grid-template-columns: 1fr; }
  .hero-stats { gap: 22px; }
  .search { border-radius: 22px; flex-direction: column; }
  .search input { height: 50px; }
  .section { padding: 56px 0; }
}

/* ---------- Wizard ---------- */
.wizard { max-width: 720px; margin: 0 auto; padding: 20px 16px 140px; }
.progress { height: 6px; border-radius: 999px; background: #e5e9e7; overflow: hidden; }
.progress i { display: block; height: 100%; background: var(--green); border-radius: 999px; transition: width .35s cubic-bezier(.2, .8, .2, 1); }
.wizard h1 { font-size: clamp(28px, 5vw, 38px); font-weight: 800; margin: 26px 0 6px; letter-spacing: -.035em; }
.wizard .lead { color: var(--muted); margin-bottom: 22px; font-size: 16px; }
.wizard-foot { position: fixed; left: 0; right: 0; bottom: 0; z-index: 31; padding: 14px 16px calc(14px + env(safe-area-inset-bottom)); background: linear-gradient(transparent, var(--bg) 30%); }
.wizard-foot .inner { max-width: 720px; margin: 0 auto; display: flex; gap: 10px; }
.fade-in { animation: fadeIn .35s cubic-bezier(.2, .8, .2, 1); }
@keyframes fadeIn { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: none; } }

.drop { border: 2px dashed #cfd6d2; border-radius: var(--radius); padding: 22px; text-align: center; cursor: pointer; transition: border-color .15s, background .15s; display: grid; gap: 6px; justify-items: center; }
.drop:hover, .drop.over { border-color: var(--green); background: var(--green-50); }
.drop .ic { width: 48px; height: 48px; border-radius: 16px; background: #fff; box-shadow: var(--shadow); display: grid; place-items: center; }
.thumbs { display: grid; grid-template-columns: repeat(auto-fill, minmax(92px, 1fr)); gap: 8px; margin-top: 12px; }
.thumb { position: relative; aspect-ratio: 1; border-radius: 14px; overflow: hidden; background: #e8ecea; display: grid; place-items: center; font-size: 12px; color: var(--muted); text-align: center; padding: 4px; }
.thumb img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.thumb .x { position: absolute; top: 4px; right: 4px; width: 24px; height: 24px; border-radius: 50%; background: rgba(0, 0, 0, .6); color: #fff; display: grid; place-items: center; font-size: 14px; z-index: 1; }
.estimate { display: flex; gap: 14px; align-items: center; padding: 16px; border-radius: var(--radius-sm); background: var(--green-50); color: #14532d; }
.estimate b { font-size: 18px; }
.summary { display: grid; gap: 0; }
.summary > div { display: flex; justify-content: space-between; gap: 16px; padding: 12px 0; border-bottom: 1px solid var(--line); }
.summary > div:last-child { border: 0; }
.summary span { color: var(--muted); }
.summary b { text-align: right; }

/* ---------- Searching (radar) ---------- */
.searching { background: var(--ink); color: #fff; border-radius: 28px; padding: 26px; display: flex; gap: 22px; align-items: center; overflow: hidden; position: relative; }
.radar { position: relative; width: 84px; height: 84px; flex: none; display: grid; place-items: center; }
.radar::before, .radar::after, .radar i { content: ''; position: absolute; inset: 0; border-radius: 50%; border: 2px solid var(--green); opacity: 0; animation: ping 2.4s cubic-bezier(0, .6, .4, 1) infinite; }
.radar::after { animation-delay: .8s; } .radar i { animation-delay: 1.6s; }
.radar b { width: 46px; height: 46px; border-radius: 50%; background: var(--green); display: grid; place-items: center; z-index: 1; box-shadow: 0 0 30px rgba(34, 197, 94, .6); }
.radar b svg { width: 22px; height: 22px; color: #fff; }
@keyframes ping { 0% { transform: scale(.5); opacity: .9; } 100% { transform: scale(1.6); opacity: 0; } }
.searching h3 { font-size: 20px; }
.searching .muted { color: rgba(255, 255, 255, .6); }
.funnel { display: flex; gap: 18px; margin-top: 12px; flex-wrap: wrap; }
.funnel div b { font-size: 22px; display: block; letter-spacing: -.02em; }
.funnel div span { font-size: 12px; color: rgba(255, 255, 255, .55); }

/* ---------- Offer card ---------- */
.offer { display: grid; gap: 14px; }
.offer.best { box-shadow: inset 0 0 0 2px var(--green), var(--shadow); }
.offer .price { font-size: 26px; font-weight: 800; letter-spacing: -.03em; white-space: nowrap; }
.offer .price small { font-size: 13px; font-weight: 600; color: var(--muted); display: block; text-align: right; letter-spacing: 0; }
.offer .msg { background: var(--bg); border-radius: 14px; padding: 12px 14px; line-height: 1.45; font-size: 15px; }
.avatar { width: 48px; height: 48px; border-radius: 16px; display: grid; place-items: center; color: #fff; font-weight: 800; font-size: 17px; flex: none; }
.avatar.lg { width: 76px; height: 76px; border-radius: 24px; font-size: 26px; }
.stars { color: var(--amber); font-weight: 700; display: inline-flex; align-items: center; gap: 3px; }
.meta { display: flex; gap: 12px; flex-wrap: wrap; font-size: 14px; color: var(--muted); }
.meta span { display: inline-flex; gap: 5px; align-items: center; }
.meta svg { width: 15px; height: 15px; }
.score { height: 6px; border-radius: 999px; background: #e9eeeb; overflow: hidden; width: 74px; }
.score i { display: block; height: 100%; background: var(--green); }

/* Assigned / success */
.matched { background: linear-gradient(135deg, #0f5132, #16a34a); color: #fff; border-radius: 28px; padding: 24px; display: grid; gap: 16px; }
.matched .muted { color: rgba(255, 255, 255, .7); }
.matched .btn.light { color: #0f5132; }

/* Job cards */
.job-card { display: grid; gap: 12px; }
.job-card h3 { font-size: 18px; line-height: 1.25; }
.job-card .desc { color: var(--muted); font-size: 14px; line-height: 1.45; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.job-card .budget { font-weight: 800; font-size: 18px; white-space: nowrap; }
.cat-ic { width: 44px; height: 44px; border-radius: 14px; background: var(--bg); display: grid; place-items: center; font-size: 22px; flex: none; }

.gallery { display: grid; grid-template-columns: repeat(auto-fill, minmax(110px, 1fr)); gap: 8px; }
.gallery a { aspect-ratio: 1; border-radius: 14px; overflow: hidden; background: #e8ecea; display: grid; place-items: center; font-size: 13px; color: var(--muted); padding: 6px; text-align: center; }
.gallery img { width: 100%; height: 100%; object-fit: cover; }

/* Online switch (майстер на лінії) */
.online { display: inline-flex; align-items: center; gap: 10px; height: 42px; padding: 0 6px 0 14px; border-radius: 999px; background: #f1f4f2; font-weight: 700; font-size: 14px; }
.online.on { background: var(--green-50); color: var(--green-600); }
.switch { width: 46px; height: 30px; border-radius: 999px; background: #cdd4d0; position: relative; transition: background .2s; }
.switch::after { content: ''; position: absolute; top: 3px; left: 3px; width: 24px; height: 24px; border-radius: 50%; background: #fff; box-shadow: 0 1px 4px rgba(0, 0, 0, .2); transition: transform .2s cubic-bezier(.2, .8, .2, 1); }
.online.on .switch { background: var(--green); }
.online.on .switch::after { transform: translateX(16px); }

/* ---------- Bottom sheet ---------- */
.overlay { position: fixed; inset: 0; z-index: 50; background: rgba(8, 12, 10, .45); display: flex; align-items: flex-end; justify-content: center; animation: fade .2s; }
@keyframes fade { from { opacity: 0; } }
.sheet { width: 100%; max-width: 560px; max-height: 92vh; background: #fff; border-radius: 28px 28px 0 0; padding: 10px 20px calc(20px + env(safe-area-inset-bottom)); display: flex; flex-direction: column; animation: up .32s cubic-bezier(.2, .8, .2, 1); }
.sheet .grab { width: 40px; height: 5px; border-radius: 999px; background: #dfe4e1; margin: 0 auto 14px; flex: none; }
.sheet h2 { font-size: 24px; font-weight: 800; }
.sheet .body { overflow-y: auto; margin: 0 -20px; padding: 0 20px; }
@keyframes up { from { transform: translateY(100%); } }
@media (min-width: 761px) { .overlay { align-items: center; } .sheet { border-radius: 28px; animation: pop .25s cubic-bezier(.2, .8, .2, 1); } .sheet .grab { display: none; } }
@keyframes pop { from { transform: scale(.96); opacity: 0; } }

/* Chat */
.chat { display: flex; flex-direction: column; gap: 6px; min-height: 260px; max-height: 52vh; overflow-y: auto; padding: 8px 2px 12px; }
.bubble { max-width: 80%; padding: 10px 14px; border-radius: 20px; line-height: 1.4; font-size: 15px; white-space: pre-wrap; word-wrap: break-word; }
.bubble.me { align-self: flex-end; background: var(--green); color: #fff; border-bottom-right-radius: 6px; }
.bubble.them { align-self: flex-start; background: #f1f4f2; border-bottom-left-radius: 6px; }
.bubble time { display: block; font-size: 11px; opacity: .65; margin-top: 3px; }
.composer { display: flex; gap: 8px; padding-top: 10px; border-top: 1px solid var(--line); }
.composer .input { height: 50px; border-radius: 999px; }
.composer .btn { width: 50px; padding: 0; flex: none; height: 50px; }

/* Rating input */
.rate { display: flex; gap: 6px; justify-content: center; margin: 10px 0 18px; }
.rate button { font-size: 40px; line-height: 1; filter: grayscale(1) opacity(.35); transition: transform .12s, filter .12s; }
.rate button.on { filter: none; }
.rate button:active { transform: scale(.88); }

/* Auth */
.auth { min-height: calc(100vh - var(--top-h)); display: grid; place-items: center; padding: 24px 16px 100px; }
.auth .card { width: 100%; max-width: 460px; padding: 28px; }
.auth h1 { font-size: 30px; font-weight: 800; letter-spacing: -.035em; }
.demo { display: grid; gap: 8px; margin-top: 18px; padding-top: 18px; border-top: 1px solid var(--line); }

/* Empty states / misc */
.empty { text-align: center; padding: 56px 20px; color: var(--muted); display: grid; gap: 12px; justify-items: center; }
.empty .big { font-size: 48px; }
.empty h3 { color: var(--text); font-size: 20px; }
.skeleton { height: 120px; border-radius: var(--radius); background: linear-gradient(90deg, #eceff0 25%, #f5f7f6 50%, #eceff0 75%); background-size: 200% 100%; animation: shimmer 1.2s infinite; }
@keyframes shimmer { to { background-position: -200% 0; } }
.status { display: inline-flex; align-items: center; gap: 6px; font-weight: 700; font-size: 13px; padding: 5px 11px; border-radius: 999px; }
.status.open { background: var(--green-50); color: var(--green-600); }
.status.assigned { background: #eef4ff; color: #1d4ed8; }
.status.completed { background: #f1f4f2; color: #374151; }
.status.cancelled { background: #fff1f1; color: #b91c1c; }
.back { font: inherit; display: inline-flex; align-items: center; gap: 6px; color: var(--muted); font-weight: 600; margin: 4px 0 14px; }
.back svg { width: 18px; height: 18px; }
.kv { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 10px; }
.kv div { background: var(--bg); border-radius: 14px; padding: 12px 14px; }
.kv span { display: block; font-size: 12px; color: var(--muted); font-weight: 600; margin-bottom: 3px; }
.kv b { font-size: 15px; }
.desc-full { line-height: 1.6; white-space: pre-wrap; }
.banner { display: flex; gap: 12px; align-items: center; padding: 14px 16px; border-radius: var(--radius-sm); background: #fff7e6; color: #92400e; font-weight: 600; }
.banner.info { background: #eef4ff; color: #1e40af; }
.hint-box { display: flex; gap: 10px; padding: 12px 14px; border-radius: 14px; font-size: 14px; font-weight: 600; }
.hint-box.ok { background: var(--green-50); color: #166534; }
.hint-box.warn { background: #fff7e6; color: #92400e; }

/* Toasts */
.toasts { position: fixed; left: 50%; top: 76px; transform: translateX(-50%); z-index: 60; display: grid; gap: 8px; width: min(92vw, 420px); pointer-events: none; }
.toast { background: var(--ink); color: #fff; padding: 14px 18px; border-radius: 16px; font-weight: 600; box-shadow: var(--shadow-lg); animation: toastIn .3s cubic-bezier(.2, .8, .2, 1); }
.toast.err { background: #b91c1c; }
@keyframes toastIn { from { opacity: 0; transform: translateY(-10px); } }

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

/* ---------- v2: сповіщення, етапи, послуги, баланс ---------- */
.link { color: var(--green-600); font-weight: 700; }
.icon-btn.lg { width: 48px; height: 48px; }
.bell { position: relative; }
.bell .badge { position: absolute; top: -2px; right: -2px; min-width: 19px; height: 19px; padding: 0 5px; border-radius: 999px; background: var(--red); color: #fff; font-size: 11px; font-weight: 800; display: grid; place-items: center; box-shadow: 0 0 0 2px #fff; }
.notif { display: grid; gap: 2px; text-align: left; padding: 12px 14px; border-radius: 14px; background: var(--bg); width: 100%; }
.notif.unread { background: var(--green-50); box-shadow: inset 3px 0 0 var(--green); }
.notif span { font-size: 14px; color: #374151; }
.notif time { font-size: 12px; color: var(--muted); }

.timeline { list-style: none; margin: 0; padding: 0; display: grid; gap: 0; }
.timeline li { position: relative; display: flex; align-items: center; gap: 12px; padding: 7px 0 7px 2px; font-weight: 600; opacity: .55; }
.timeline li i { width: 14px; height: 14px; border-radius: 50%; border: 2px solid currentColor; flex: none; position: relative; z-index: 1; background: transparent; }
.timeline li:not(:last-child)::after { content: ''; position: absolute; left: 8px; top: 24px; bottom: -8px; width: 2px; background: currentColor; opacity: .3; }
.timeline li.done { opacity: 1; }
.timeline li.done i { background: currentColor; }
.timeline li.now { opacity: 1; }
.timeline li.now i { animation: pulse 1.6s ease-in-out infinite; }
.timeline li.err { opacity: 1; color: #fecaca; }
.timeline time { margin-left: auto; font-size: 13px; opacity: .75; font-variant-numeric: tabular-nums; }
@keyframes pulse { 50% { box-shadow: 0 0 0 6px rgba(255, 255, 255, .25); } }

.svc-editor { display: grid; gap: 8px; }
.svc-sec { border-radius: 14px; background: #f1f4f2; }
.svc-sec summary { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 12px 14px; cursor: pointer; font-weight: 700; list-style: none; }
.svc-sec summary::-webkit-details-marker { display: none; }
.svc-sec summary .chip:empty { display: none; }
.svc-list { display: grid; gap: 2px; padding: 0 8px 8px; }
.svc-row { display: flex; align-items: center; gap: 8px; padding: 8px 8px; border-radius: 10px; background: #fff; }
.svc-row label { display: flex; align-items: center; gap: 10px; cursor: pointer; font-weight: 500; }
.svc-row input { width: 18px; height: 18px; accent-color: var(--green); }
.svc-row.on { box-shadow: inset 0 0 0 1.5px var(--green); }
.star-btn { width: 34px; height: 34px; border-radius: 10px; font-size: 18px; color: #c9d1cc; }
.star-btn.on { color: var(--amber); background: #fff7e6; }
.range { width: 100%; accent-color: var(--green); height: 28px; }

.svc-chips { gap: 8px; }
.chip.big { height: auto; min-height: 40px; padding: 8px 14px; font-size: 14px; flex-direction: column; align-items: flex-start; gap: 0; border-radius: 14px; cursor: pointer; }
.chip.big small { font-size: 12px; font-weight: 500; opacity: .75; }
.cat .cat-sub { font-size: 13px; font-weight: 500; color: var(--muted); line-height: 1.4; }
.steps.four { grid-template-columns: repeat(4, 1fr); }
@media (max-width: 900px) { .steps.four { grid-template-columns: 1fr 1fr; } }
@media (max-width: 560px) { .steps.four { grid-template-columns: 1fr; } }
.meta .dist { color: var(--text); font-weight: 700; }
.chip.dark svg { width: 14px; height: 14px; }
.hint svg { width: 15px; height: 15px; vertical-align: -2px; }

.balance { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.balance > div { background: var(--ink); color: #fff; border-radius: 20px; padding: 18px; display: grid; gap: 4px; }
.balance > div:last-child { background: #fff; color: var(--text); box-shadow: var(--shadow); }
.balance span { font-size: 13px; opacity: .7; font-weight: 600; }
.balance b { font-size: 26px; letter-spacing: -.03em; font-variant-numeric: tabular-nums; }
.balance small { font-size: 12px; opacity: .6; }
@media (max-width: 420px) { .balance { grid-template-columns: 1fr; } }

/* ---------- v3: телефон, ШІ, миттєві, проєкти, «Мій дім», адмінка ---------- */
.grid-3 { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
.mini-avatar { width: 30px; height: 30px; border-radius: 50%; object-fit: cover; }
.avatar.photo { overflow: hidden; background: #e8ecea; }
.avatar.photo img { width: 100%; height: 100%; object-fit: cover; }
.code-input { font-size: 26px; letter-spacing: .4em; text-align: center; font-weight: 700; }
.banner.light { background: rgba(255, 255, 255, .95); color: #1f2937; }
.banner.info a, a.banner { color: inherit; }
.banner.surcharge { flex-wrap: wrap; }

.ai-banner { display: flex; gap: 14px; align-items: center; padding: 16px 18px; border-radius: 20px; cursor: pointer;
  background: linear-gradient(135deg, #0f5132, #16a34a); color: #fff; box-shadow: 0 10px 26px rgba(22, 163, 74, .3); }
.ai-banner svg { width: 30px; height: 30px; flex: none; }
.ai-banner b { display: block; font-size: 17px; }
.ai-banner span { font-size: 14px; opacity: .85; }
.ai-banner.loading { opacity: .8; pointer-events: none; animation: pulse 1.4s ease-in-out infinite; }

.pills.two { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.instant-card { box-shadow: inset 0 0 0 2px var(--amber), var(--shadow); }
.job-card.instant { box-shadow: inset 0 0 0 2px #fcd34d, var(--shadow); }
.plain-list { margin: 0; padding-left: 18px; display: grid; gap: 6px; color: #374151; font-size: 15px; }

/* Порівняння кошторисів */
.compare-wrap { padding: 6px; overflow-x: auto; }
.compare-est { width: 100%; min-width: 520px; border-collapse: collapse; font-size: 14px; }
.compare-est th, .compare-est td { padding: 8px 10px; border-bottom: 1px solid var(--line); text-align: left; vertical-align: top; }
.compare-est th { font-size: 13px; }
.compare-est .n { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
.compare-est small { display: block; color: var(--muted); font-size: 12px; font-weight: 500; }
.compare-est tr.stage td { background: var(--bg); font-weight: 700; font-size: 13px; }
.compare-est td.best { color: var(--green-600); font-weight: 700; background: var(--green-50); }
.compare-est tr.total td { font-weight: 800; font-size: 15px; border-bottom: 0; }

/* Етапи проєкту */
.ms-progress { display: grid; gap: 6px; }
.progress.light { background: rgba(255, 255, 255, .25); }
.progress.light i { background: #fff; }
.ms-list { display: grid; gap: 8px; }
.ms { background: rgba(255, 255, 255, .1); border-radius: 14px; padding: 12px; display: grid; gap: 6px; }
.ms.approved { opacity: .75; }
.ms.review { background: rgba(255, 255, 255, .2); box-shadow: inset 0 0 0 1.5px rgba(255, 255, 255, .5); }
.ms .chip { height: 24px; font-size: 12px; white-space: nowrap; flex: none; }
.gallery.mini { grid-template-columns: repeat(auto-fill, minmax(64px, 1fr)); gap: 6px; }
.gallery.mini a { border-radius: 10px; padding: 0; }

/* Редактор кошторису майстра */
.est-form { display: grid; gap: 4px; }
.est-stage { font-weight: 800; font-size: 13px; text-transform: uppercase; letter-spacing: .04em; color: var(--muted); margin-top: 10px; }
.est-row { display: flex; align-items: center; gap: 6px; padding: 6px 0; border-bottom: 1px solid var(--line); font-size: 14px; flex-wrap: wrap; }
.est-row .grow { min-width: 160px; }
.input.sm { height: 38px; width: 74px; padding: 0 8px; font-size: 14px; border-radius: 10px; text-align: right; }
.est-row .unit { color: var(--muted); font-size: 13px; min-width: 28px; }
.est-row .line-sum { min-width: 86px; text-align: right; font-variant-numeric: tabular-nums; }
.est-total { padding: 10px 0 0; font-size: 18px; }

/* «Мій дім» */
.hist { display: grid; gap: 2px; }
.hist-row { display: flex; gap: 10px; align-items: center; padding: 10px 4px; border-bottom: 1px solid var(--line); flex-wrap: wrap; }
.hist-row:last-child { border-bottom: 0; }
.cat-ic.sm { width: 36px; height: 36px; font-size: 18px; border-radius: 12px; }

/* Чат */
.sys-msg { align-self: center; max-width: 90%; text-align: center; font-size: 13px; color: var(--muted); background: var(--bg); padding: 6px 12px; border-radius: 999px; }
.sys-msg time { margin-left: 6px; opacity: .7; font-size: 11px; }
.chat-img { max-width: 220px; max-height: 220px; border-radius: 14px; display: block; }
.bubble .masked { display: block; font-size: 11px; opacity: .75; font-style: normal; margin-top: 2px; }
.composer .icon-btn { height: 50px; width: 50px; cursor: pointer; }

/* Профіль */
.avatar-edit { position: relative; cursor: pointer; flex: none; }
.avatar-edit > span { position: absolute; right: -4px; bottom: -4px; width: 30px; height: 30px; border-radius: 50%; background: var(--ink); color: #fff; display: grid; place-items: center; box-shadow: 0 0 0 3px var(--bg); }
.avatar-edit > span svg { width: 16px; height: 16px; }
.small-drop { padding: 14px; }
.pf-item { position: relative; display: grid; gap: 4px; }
.pf-item a { aspect-ratio: 1; border-radius: 14px; overflow: hidden; display: block; background: #e8ecea; }
.pf-item img { width: 100%; height: 100%; object-fit: cover; }
.pf-item span { font-size: 12px; color: var(--muted); }
.pf-item .x { position: absolute; top: 4px; right: 4px; width: 24px; height: 24px; border-radius: 50%; background: rgba(0, 0, 0, .6); color: #fff; }

/* Адмінка */
.admin h3 { font-size: 17px; }
.kpis { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; }
.kpi { background: #fff; border-radius: 18px; padding: 18px; box-shadow: var(--shadow); display: grid; gap: 4px; align-content: start; }
.kpi b { font-size: 26px; letter-spacing: -.03em; font-variant-numeric: tabular-nums; }
.kpi span { font-size: 14px; color: #374151; }
.kpi small { font-size: 12px; color: var(--muted); }
@media (max-width: 760px) { .kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
.funnel-bars { display: grid; gap: 8px; }
.fb-row { display: grid; grid-template-columns: 130px 1fr 40px; gap: 10px; align-items: center; font-size: 14px; }
.fb { height: 14px; background: var(--bg); border-radius: 999px; overflow: hidden; }
.fb i { display: block; height: 100%; background: var(--green); border-radius: 999px; }
.fb-row b { text-align: right; font-variant-numeric: tabular-nums; }
.tap-row { padding: 8px 0; border-bottom: 1px solid var(--line); }
.ver-img { display: grid; gap: 4px; font-size: 13px; color: var(--muted); }
.ver-img img { width: 100%; aspect-ratio: 4 / 3; object-fit: cover; border-radius: 12px; background: #e8ecea; }
.adm-msg { padding: 6px 0; border-bottom: 1px solid var(--line); font-size: 14px; }
.adm-msg.system { color: var(--muted); font-size: 13px; }

/* ---------- v4: зрізи, слоти клієнта, розклад майстра ---------- */
.timing-pills { grid-template-columns: repeat(3, minmax(0, 1fr)); }
@media (max-width: 420px) { .timing-pills { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
.slot-days { display: grid; gap: 8px; }
.slot-day { display: grid; gap: 8px; padding: 12px 14px; border-radius: var(--radius-sm); background: #f6f8f7; }
.slot-day > b { font-size: 14px; }
.slot-chips { display: flex; flex-wrap: wrap; gap: 6px; }
.chip-btn { height: 34px; padding: 0 12px; border-radius: 999px; border: 1.5px solid var(--line); background: #fff; font: inherit; font-size: 13.5px; font-weight: 600; color: var(--ink); cursor: pointer; white-space: nowrap; }
.chip-btn.on { background: var(--ink); border-color: var(--ink); color: #fff; }
.chip-btn.ghost { border-style: dashed; color: var(--muted); }
.slot-custom { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.select.sm { height: 38px; width: auto; padding: 0 28px 0 10px; font-size: 14px; border-radius: 10px; }
.slot-text { font-weight: 500; font-size: 13.5px; color: var(--muted); }
.meta .fit { color: #15803d; font-weight: 600; }
.week-editor { display: grid; gap: 6px; }
.week-row { display: grid; grid-template-columns: 74px 1fr; align-items: center; gap: 10px; padding: 8px 12px; border-radius: 12px; background: #f6f8f7; }
.week-row.off .week-times { opacity: .35; pointer-events: none; }
.week-row label { display: flex; align-items: center; gap: 8px; font-weight: 700; }
.week-times { display: flex; align-items: center; gap: 6px; }
.time-pick { display: grid; gap: 6px; }
.time-pick .chip-btn.mine::after { content: ' ✓'; }
.week-times .select.sm, .slot-custom .select.sm { min-width: 100px; }
