:root {
  font-family: Inter, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  color: #141923;
  background: #f3f4f6;
  font-size: 17px;
  --blue: #095eb3;
  --bright: #146cdd;
  --muted: #596576;
  --line: #dce2ea;
  --surface: #fff;
  --nav: 82px;
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }
body { margin: 0; }
a { color: inherit; text-decoration: none; }
button, input, textarea, select { font: inherit; }
button, a, input, select, textarea { -webkit-tap-highlight-color: transparent; }
button { cursor: pointer; }
button:disabled { cursor: wait; opacity: .62; }
a:focus-visible, button:focus-visible { outline: 3px solid #146cdd; outline-offset: 3px; }
svg { display: block; width: 24px; height: 24px; flex: 0 0 auto; }
h1, h2, p { margin: 0; }
h1 { font-size: 27px; letter-spacing: -.035em; }
h2 { font-size: 23px; letter-spacing: -.025em; }
.screen { width: min(100%, 640px); margin: 0 auto; padding: max(20px, env(safe-area-inset-top)) 16px 28px; }
.page-home, .page-contacts { padding-bottom: calc(var(--nav) + env(safe-area-inset-bottom) + 24px); }
.loading, .connection { max-width: 440px; margin: 40px auto; padding: 20px; }
.connection button { margin-top: 18px; }
.muted { color: var(--muted); font-size: 16px; }
.spaced { margin: 16px; }
.surface { border-radius: 24px; background: var(--surface); }
.primary, .secondary { min-height: 54px; border-radius: 14px; border: 0; padding: 12px 20px; font-weight: 650; }
.primary { background: var(--blue); color: white; width: 100%; }
.secondary { background: #e9f2ff; color: #084f99; }
.error { color: #a32132; font-size: 16px; }
.error:empty { display: none; }
.top { display: grid; grid-template-columns: 46px 1fr 46px; align-items: center; gap: 8px; margin-bottom: 18px; min-height: 50px; }
.top h1 { font-size: clamp(19px, 5.5vw, 24px); text-align: center; }
.icon-link { border: 0; background: transparent; color: var(--blue); min-width: 46px; min-height: 46px; display: grid; place-items: center; border-radius: 13px; padding: 0; }
.title { padding: 6px 2px 22px; }
.greeting { display: flex; gap: 9px; align-items: center; margin-bottom: 16px; }
.profile-link { display: grid; place-items: center; width: 44px; height: 44px; border-radius: 50%; background: white; color: #182331; }
.search { display: flex; align-items: center; gap: 10px; background: white; border: 1px solid #e2e6eb; border-radius: 14px; padding: 0 13px; color: #5e6977; }
.search:focus-within { border-color: var(--bright); }
.search input { width: 100%; min-width: 0; height: 51px; appearance: none; border: 0; background: transparent; color: #172235; outline: none; padding: 0; }
.search input::placeholder { color: #687486; }
.featured { margin-top: 16px; }
.office { --picture: url('/office.webp'); --card-base: #163657; }
.flat { --picture: url('/flat.webp'); --card-base: #685744; }
.house { --picture: url('/house.webp'); --card-base: #34495a; }
.object-card { min-height: 133px; display: flex; justify-content: space-between; align-items: end; gap: 8px; padding: 17px; border-radius: 21px; color: white; background: linear-gradient(90deg,#071c33ef 0%,#0a1f34a8 62%,#0b223752 100%), var(--picture) center 57% / cover, var(--card-base); }
.object-card.hero { min-height: clamp(180px, 48vw, 265px); align-items: end; padding: 19px; }
.object-copy { display: grid; gap: 6px; }
.object-name { font-weight: 730; font-size: 22px; line-height: 1.15; letter-spacing: -.025em; }
.hero .object-name { max-width: 290px; font-size: clamp(24px, 6.8vw, 34px); }
.object-area { font-size: 17px; font-weight: 600; color: #e3f0ff; }
.card-arrow { display: grid; place-items: center; flex: 0 0 40px; height: 40px; border-radius: 50%; background: #102d4eaa; border: 1px solid #ffffff5c; }
.card-arrow svg { width: 19px; height: 19px; }
.tools { display: flex; gap: 16px; margin: 16px 0 19px; }
.tools a { display: grid; justify-items: center; gap: 6px; min-width: 70px; border-radius: 15px; font-size: 16px; padding: 2px 1px; }
.tool-icon { display: grid; place-items: center; width: 55px; height: 55px; border-radius: 16px; color: var(--blue); background: #fff; }
.tool-icon svg { width: 28px; height: 28px; }
.tool-icon.qr { color: white; background: var(--blue); }
.objects { background: white; border-radius: 24px; padding: 17px; }
.objects h2 { margin-bottom: 12px; }
.object-list { display: grid; gap: 10px; }
#nav { position: fixed; z-index: 5; left: 50%; transform: translateX(-50%); width: min(100%, 640px); bottom: 0; display: grid; grid-template-columns: repeat(3,1fr); align-items: end; min-height: calc(var(--nav) + env(safe-area-inset-bottom)); padding: 7px 8px calc(7px + env(safe-area-inset-bottom)); border: 1px solid #e1e6ed; border-bottom: 0; background: #fff; }
#nav a { display: grid; justify-items: center; align-content: end; gap: 5px; min-height: 59px; padding: 0 3px 2px; border-radius: 13px; color: #536174; font-size: 15px; font-weight: 600; }
#nav a[aria-current] { color: var(--blue); }
#nav svg { width: 25px; height: 25px; }
#nav .nav-chat { color: var(--blue); }
.nav-chat span { width: 49px; height: 49px; display: grid; place-items: center; background: var(--bright); color: white; border-radius: 50%; box-shadow: 0 3px 9px #146cdd28; }
.nav-chat svg { fill: #ffffff35; }
.contact-list { padding: 0 16px; }
.contact { display: flex; align-items: center; gap: 14px; padding: 16px 0; }
.contact + .contact { border-top: 1px solid var(--line); }
.contact p { color: var(--muted); margin-top: 3px; }
.avatar { display: grid; place-items: center; width: 48px; height: 48px; border-radius: 50%; color: #074c92; background: #e6f1ff; font-weight: 700; }
.profile { display: grid; justify-items: center; gap: 12px; padding: 24px; }
.profile button { width: min(100%,250px); margin-top: 8px; }
.detail { background: white; border-radius: 24px; overflow: hidden; padding-bottom: 20px; }
.detail-photo { height: clamp(145px, 45vw, 250px); background: var(--picture) center / cover, var(--card-base); }
.detail h2, .detail p { margin: 10px 18px 0; }
.detail p { color: var(--muted); }
.login { min-height: 100dvh; background: white; display: grid; align-items: start; }
.login-inner { width: min(100%, 445px); margin: 0 auto; padding: max(76px, env(safe-area-inset-top)) 20px 40px; }
.brand { color: var(--blue); font-size: clamp(48px, 12vw, 65px); font-weight: 800; letter-spacing: -.07em; line-height: 1; margin-bottom: clamp(48px, 11vh, 90px); }
.login h1 { margin-bottom: 20px; }
.login form, .calc-form, #mix-rate, #segments { display: grid; gap: 17px; }
.login label, .calc-form label { display: grid; gap: 7px; font-weight: 560; min-width: 0; }
.login input, .calc-form input, .calc-form select { width: 100%; min-width: 0; min-height: 53px; background: white; color: #172235; border: 1px solid #cdd6e1; border-radius: 13px; padding: 10px 12px; }
.login input:focus, .calc-form input:focus, .calc-form select:focus { outline: 2px solid var(--bright); outline-offset: 1px; }
.password { position: relative; }
.password input { padding-right: 55px; }
.password button { position: absolute; right: 3px; top: 3px; }
.login .primary { margin-top: 5px; }
.calculator-list { padding: 4px 14px; }
.calculator-list a { min-height: 74px; display: flex; align-items: center; gap: 12px; font-weight: 650; }
.calculator-list a + a { border-top: 1px solid var(--line); }
.calculator-list .tool-icon { width: 47px; height: 47px; background: #edf5ff; flex: 0 0 47px; }
.calculator-list .next { margin-left: auto; color: var(--blue); }
.calc-form { padding: 18px; }
.calc-form small { color: var(--muted); font-size: 15px; margin-top: -10px; }
.field-row { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 10px; }
.add-segment { display: flex; align-items: center; justify-content: center; gap: 8px; }
output { padding: 14px 16px; background: #e9f2ff; color: #074c92; border-radius: 15px; display: grid; gap: 4px; }
output strong { font-size: 28px; }
.camera { position: relative; aspect-ratio: 1/1; background: #112239; border-radius: 22px; overflow: hidden; }
.camera video { width: 100%; height: 100%; object-fit: cover; }
.scan-frame { position: absolute; inset: 14%; border: 3px solid #fff; border-radius: 16px; box-shadow: 0 0 0 200px #07101c70; pointer-events: none; }
.scanner-content { display: grid; justify-items: center; text-align: center; gap: 12px; padding: 20px 8px; }
body:has(.page-chat) { background: white; }
.page-chat { display: grid; grid-template-rows: auto minmax(0,1fr) auto; padding-bottom: 5px; height: calc(100dvh - var(--nav) - env(safe-area-inset-bottom)); }
.page-chat .top { margin-bottom: 0; }
.messages { overflow-y: auto; min-height: 0; display: flex; flex-direction: column; gap: 20px; padding: 15px 1px; }
.chat-empty { margin: auto; text-align: center; }
.chat-empty h2 { font-size: 29px; }
.message { line-height: 1.5; white-space: pre-wrap; overflow-wrap: anywhere; }
.message.user { background: #eaf3ff; border-radius: 20px 20px 5px 20px; padding: 11px 15px; align-self: end; max-width: 84%; }
.message.assistant { max-width: 95%; }
.composer { display: flex; align-items: end; padding: 5px; gap: 4px; background: white; border: 1px solid #dbe4ef; box-shadow: 0 2px 10px #1023420e; border-radius: 25px; }
.composer textarea { min-height: 43px; width: 100%; outline: 0; resize: none; field-sizing: content; max-height: 115px; border: 0; padding: 10px; background: transparent; color: #162133; }
.composer:focus-within { border-color: var(--bright); }
.composer button { border: 0; background: var(--blue); color: white; height: 43px; flex: 0 0 43px; display: grid; place-items: center; padding: 0; border-radius: 50%; }
.chat-note { text-align: center; font-size: 14px; color: var(--muted); padding: 5px 2px; }
.chat-note:empty { display: none; }
@media (min-width: 540px) {
  .screen { padding-left: 22px; padding-right: 22px; }
  #nav { border-radius: 18px 18px 0 0; }
  .object-list { grid-template-columns: repeat(2, minmax(0,1fr)); }
  .object-list > :only-child { grid-column: 1/-1; }
}
