@font-face {
  font-family: "Golos Text";
  font-style: normal;
  font-display: swap;
  font-weight: 400 900;
  src: url("/miniapp/fonts/golos-text-cyrillic-ext-wght-normal.woff2") format("woff2");
  unicode-range: U+0460-052F, U+1C80-1C8A, U+20B4, U+2DE0-2DFF, U+A640-A69F, U+FE2E-FE2F;
}

@font-face {
  font-family: "Golos Text";
  font-style: normal;
  font-display: swap;
  font-weight: 400 900;
  src: url("/miniapp/fonts/golos-text-cyrillic-wght-normal.woff2") format("woff2");
  unicode-range: U+0301, U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116;
}

@font-face {
  font-family: "Golos Text";
  font-style: normal;
  font-display: swap;
  font-weight: 400 900;
  src: url("/miniapp/fonts/golos-text-latin-ext-wght-normal.woff2") format("woff2");
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}

@font-face {
  font-family: "Golos Text";
  font-style: normal;
  font-display: swap;
  font-weight: 400 900;
  src: url("/miniapp/fonts/golos-text-latin-wght-normal.woff2") format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

:root {
  color-scheme: light;
  --app-bg: #f1f8ff;
  --surface: #ffffff;
  --surface-strong: #ffffff;
  --surface-raised: #e9f5ff;
  --surface-highlight: #cfe9ff;
  --text: #002132;
  --muted: #4d6879;
  --accent: #002132;
  --accent-hover: #1c3b4d;
  --accent-pressed: #001621;
  --accent-text: #ffffff;
  --line: #88a5bc;
  --soft-accent: #e9f5ff;
  --soft-hover: #dff0ff;
  --soft-pressed: #cfe6fa;
  --shadow: 0 18px 54px rgba(0, 33, 50, 0.18);
  --font-body: "Golos Text", "Segoe UI", system-ui, -apple-system, BlinkMacSystemFont, sans-serif;
  --font-heading: "Stapel Medium", "Stapel", "Golos Text", "Segoe UI", system-ui, sans-serif;
  --safe-top: var(--tg-content-safe-area-inset-top, env(safe-area-inset-top, 0px));
  --safe-right: var(--tg-content-safe-area-inset-right, env(safe-area-inset-right, 0px));
  --safe-bottom: var(--tg-content-safe-area-inset-bottom, env(safe-area-inset-bottom, 0px));
  --safe-left: var(--tg-content-safe-area-inset-left, env(safe-area-inset-left, 0px));
  font-family: var(--font-body);
}

* {
  box-sizing: border-box;
}

[hidden] {
  display: none !important;
}

html,
body {
  width: 100%;
  height: 100%;
  margin: 0;
  overscroll-behavior: none;
  background: var(--app-bg);
  color: var(--text);
}

body {
  overflow: hidden;
  -webkit-tap-highlight-color: transparent;
}

button,
a {
  font: inherit;
}

button {
  font-family: var(--font-body);
  font-weight: 500;
  -webkit-tap-highlight-color: transparent;
}

button:focus-visible,
a:focus-visible {
  outline: 3px solid var(--line);
  outline-offset: 2px;
}

.miniapp-shell,
.map-view,
.article-view,
.account-view {
  width: 100%;
  height: var(--tg-viewport-stable-height, 100dvh);
  min-height: 100svh;
}

.miniapp-shell {
  position: relative;
  overflow: hidden;
}

body[data-paper-surface="web"] .miniapp-shell,
body[data-paper-surface="web"] .map-view,
body[data-paper-surface="web"] .article-view,
body[data-paper-surface="web"] .account-view {
  height: 100dvh;
  min-height: 100dvh;
}

/*
 * Firefox for Android can expose the system navigation bar through
 * safe-area-inset-bottom even though 100dvh already excludes that bar.
 * Avoid applying the same inset twice on the public web surface.
 */
@supports (-moz-appearance: none) {
  body[data-paper-surface="web"] {
    --safe-bottom: 0px;
  }
}

.map-view {
  position: relative;
  overflow: hidden;
  background: var(--soft-hover);
}

#miniapp-map {
  position: absolute;
  inset: 0;
}

#miniapp-map .maplibregl-canvas {
  touch-action: none;
}

.map-brand {
  position: absolute;
  z-index: 4;
  top: calc(12px + var(--safe-top));
  left: calc(12px + var(--safe-left));
  max-width: min(290px, calc(100vw - 86px - var(--safe-left) - var(--safe-right)));
  padding: 11px 14px 12px;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: color-mix(in srgb, var(--surface) 96%, transparent);
  box-shadow: 0 8px 28px rgba(0, 33, 50, 0.14);
  backdrop-filter: blur(14px) saturate(1.12);
}

.map-brand__eyebrow,
.house-card__label,
.article-heading__eyebrow {
  margin: 0 0 3px;
  color: var(--accent);
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.12em;
  line-height: 1.2;
  text-transform: uppercase;
}

.map-brand h1 {
  margin: 0;
  font-family: var(--font-heading);
  font-size: clamp(22px, 6vw, 29px);
  font-weight: 500;
  letter-spacing: -0.025em;
  line-height: 1.02;
}

.map-brand__summary {
  margin: 4px 0 0;
  color: var(--muted);
  font-size: 12px;
  font-weight: 600;
  line-height: 1.25;
}

.account-control {
  position: absolute;
  z-index: 8;
  top: calc(12px + var(--safe-top));
  right: calc(10px + var(--safe-right));
  display: flex;
  flex-direction: column;
  align-items: flex-end;
}

.account-button {
  width: 48px;
  height: 48px;
  display: grid;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: 50%;
  padding: 0;
  appearance: none;
  background: var(--surface-raised);
  box-shadow: 0 8px 28px rgba(0, 33, 50, 0.16);
  color: var(--text);
  font-size: 22px;
  line-height: 1;
  cursor: pointer;
  backdrop-filter: blur(14px) saturate(1.12);
  -webkit-tap-highlight-color: transparent;
}

.account-button svg {
  width: 25px;
  height: 25px;
}

.account-menu {
  width: min(240px, calc(100vw - 24px));
  margin-top: 8px;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: color-mix(in srgb, var(--surface) 97%, transparent);
  box-shadow: 0 14px 42px rgba(0, 33, 50, 0.2);
  backdrop-filter: blur(16px);
}

.account-menu__identity {
  display: flex;
  flex-direction: column;
  gap: 3px;
  padding: 14px 15px 12px;
  border-bottom: 1px solid var(--line);
}

.account-menu__identity strong {
  overflow: hidden;
  font-size: 14px;
  line-height: 1.25;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.account-menu__identity span {
  overflow: hidden;
  color: var(--muted);
  font-size: 11px;
  line-height: 1.3;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.account-menu > button {
  width: 100%;
  min-height: 46px;
  border: 0;
  padding: 0 15px;
  background: transparent;
  color: var(--text);
  font-size: 14px;
  font-weight: 500;
  text-align: left;
  cursor: pointer;
}

.account-menu > button + button {
  border-top: 1px solid var(--line);
}

.account-menu > .account-menu__danger {
  color: #a03128;
}

.gesture-hint {
  position: absolute;
  z-index: 3;
  top: calc(112px + var(--safe-top));
  left: 50%;
  max-width: min(310px, calc(100vw - 32px));
  margin: 0;
  padding: 8px 12px;
  border-radius: 999px;
  background: rgba(0, 33, 50, 0.86);
  color: #fff;
  font-size: 12px;
  font-weight: 650;
  line-height: 1.25;
  text-align: center;
  transform: translateX(-50%);
  transition: opacity 220ms ease, transform 220ms ease;
  pointer-events: none;
}

.gesture-hint.is-hidden {
  opacity: 0;
  transform: translate(-50%, -8px);
}

.map-loading {
  position: absolute;
  z-index: 7;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 24px;
  background: color-mix(in srgb, var(--surface) 78%, transparent);
  color: var(--text);
  font-size: 14px;
  font-weight: 700;
  backdrop-filter: blur(5px);
}

.map-loading.is-error {
  text-align: center;
}

.map-loading__spinner {
  width: 20px;
  height: 20px;
  flex: 0 0 auto;
  border: 2px solid color-mix(in srgb, var(--accent) 22%, transparent);
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: spin 700ms linear infinite;
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

.house-card {
  position: absolute;
  z-index: 6;
  right: calc(10px + var(--safe-right));
  bottom: calc(10px + var(--safe-bottom));
  left: calc(10px + var(--safe-left));
  display: grid;
  grid-template-columns: minmax(112px, 38%) minmax(0, 1fr);
  max-width: 620px;
  max-height: min(280px, calc(100dvh - 160px));
  margin: 0 auto;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 22px;
  background: var(--surface);
  color: var(--text);
  box-shadow: var(--shadow);
  animation: card-in 220ms cubic-bezier(0.2, 0.78, 0.25, 1);
}

.house-card:not(.has-image) {
  grid-template-columns: minmax(0, 1fr);
}

@keyframes card-in {
  from {
    opacity: 0;
    transform: translateY(16px) scale(0.98);
  }
}

.house-card__close {
  position: absolute;
  z-index: 2;
  top: 8px;
  right: 8px;
  width: 34px;
  height: 34px;
  border: 1px solid var(--line);
  border-radius: 50%;
  background: color-mix(in srgb, var(--surface-raised) 92%, transparent);
  box-shadow: 0 2px 12px rgba(0, 33, 50, 0.14);
  color: var(--text);
  font-size: 24px;
  line-height: 1;
  cursor: pointer;
  backdrop-filter: blur(8px);
}

.house-card__media {
  position: relative;
  min-height: 178px;
  margin: 0;
  overflow: hidden;
  background: var(--soft-accent);
}

.house-card__media picture {
  width: 100%;
  height: 100%;
  min-height: 178px;
  display: block;
}

.house-card__media img {
  width: 100%;
  height: 100%;
  min-height: 178px;
  display: block;
  object-fit: cover;
}

.house-card__media figcaption {
  position: absolute;
  right: 7px;
  bottom: 6px;
  left: 7px;
  overflow: hidden;
  padding: 5px 7px;
  border-radius: 8px;
  background: rgba(0, 33, 50, 0.74);
  color: #fff;
  font-size: 9px;
  line-height: 1.25;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.house-card__media figcaption:empty {
  display: none;
}

.house-card__content {
  min-width: 0;
  display: flex;
  flex-direction: column;
  align-items: stretch;
  padding: 17px 16px 15px;
}

.house-card__label {
  padding-right: 30px;
}

.house-card h2 {
  display: -webkit-box;
  margin: 0 32px 6px 0;
  overflow: hidden;
  font-family: var(--font-heading);
  font-size: clamp(18px, 4.7vw, 24px);
  font-weight: 500;
  letter-spacing: -0.018em;
  line-height: 1.13;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 3;
}

.house-card__address {
  display: -webkit-box;
  margin: 0 0 13px;
  overflow: hidden;
  color: var(--muted);
  font-size: 12px;
  font-weight: 600;
  line-height: 1.35;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
}

.house-card__action,
.article-error button {
  width: 100%;
  min-height: 42px;
  margin-top: auto;
  border: 0;
  border-radius: 12px;
  padding: 0 14px;
  background: var(--accent);
  color: var(--accent-text);
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
}

.house-card__action:disabled {
  opacity: 0.48;
  cursor: default;
}

.house-card__unavailable {
  margin: 8px 0 0;
  color: var(--muted);
  font-size: 11px;
  line-height: 1.3;
  text-align: center;
}

.maplibregl-ctrl-bottom-right {
  right: calc(8px + var(--safe-right));
  bottom: calc(8px + var(--safe-bottom));
}

.maplibregl-ctrl-attrib {
  font-size: 9px;
}

.maplibregl-canvas:focus-visible {
  outline: 3px solid color-mix(in srgb, var(--accent) 40%, transparent);
  outline-offset: -3px;
}

.article-view {
  position: relative;
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
  overflow: hidden;
  background: var(--app-bg);
}

.account-view {
  position: relative;
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
  overflow: hidden;
  background:
    radial-gradient(circle at 90% 0%, color-mix(in srgb, var(--surface-highlight) 72%, transparent), transparent 42%),
    var(--app-bg);
}

.article-toolbar {
  position: relative;
  z-index: 2;
  min-height: calc(54px + var(--safe-top));
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: end;
  padding:
    calc(8px + var(--safe-top))
    calc(12px + var(--safe-right))
    8px
    calc(12px + var(--safe-left));
  border-bottom: 1px solid var(--line);
  background: color-mix(in srgb, var(--surface) 96%, transparent);
  backdrop-filter: blur(14px);
}

.article-toolbar p {
  grid-column: 2;
  align-self: center;
  margin: 0;
  color: var(--muted);
  font-size: 12px;
  font-weight: 500;
  letter-spacing: 0.02em;
}

.article-back {
  grid-column: 1;
  justify-self: start;
  min-height: 38px;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 0 10px;
  background: var(--soft-accent);
  color: var(--accent);
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
}

.article-back__icon {
  width: 18px;
  height: 18px;
  display: block;
  flex: 0 0 auto;
  overflow: visible;
}

.article-back__icon path {
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
  vector-effect: non-scaling-stroke;
}

.article-scroll {
  min-height: 0;
  overflow-x: hidden;
  overflow-y: auto;
  overscroll-behavior-y: contain;
  -webkit-overflow-scrolling: touch;
  scroll-behavior: smooth;
  padding-bottom: calc(28px + var(--safe-bottom));
}

.article-loading {
  min-height: 52vh;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  color: var(--muted);
  font-size: 14px;
  font-weight: 700;
}

.article-heading {
  width: min(760px, 100%);
  margin: 0 auto;
  padding: 30px 20px 22px;
}

.article-heading h1 {
  margin: 0;
  font-family: var(--font-heading);
  font-size: clamp(30px, 8vw, 48px);
  font-weight: 500;
  letter-spacing: -0.035em;
  line-height: 1.05;
}

.article-heading > p:last-child {
  margin: 11px 0 0;
  color: var(--muted);
  font-size: 15px;
  font-weight: 650;
  line-height: 1.4;
}

.article-body {
  width: min(760px, 100%);
  margin: 0 auto;
  padding: 0 20px;
}

.article-body .history-document__header {
  display: none;
}

.article-body .history-document,
.article-body .history-document__body {
  margin: 0;
}

.article-body .history-document__archive-note {
  margin: 0 0 28px;
  border-left: 3px solid var(--accent);
  border-radius: 0 12px 12px 0;
  padding: 0 15px;
  background: var(--app-bg);
  color: var(--muted);
}

.article-body .history-document__archive-note p {
  margin: 0;
  font-size: 14px;
  line-height: 1.5;
}

.article-body .history-fragment {
  margin: 0 0 18px;
}

.article-body .history-fragment--image {
  margin: 26px -20px 10px;
}

.article-body .history-fragment__figure {
  margin: 0;
}

.article-body .history-fragment__figure img {
  width: 100%;
  height: auto;
  display: block;
  background: color-mix(in srgb, var(--muted) 12%, transparent);
}

.article-body .history-fragment__text {
  margin: 0;
  color: var(--text);
  font-size: 17px;
  line-height: 1.62;
  white-space: normal;
  overflow-wrap: break-word;
}

.article-body .history-fragment__text--title,
.article-body .history-fragment__text--heading,
.article-body .history-fragment__text--subheading {
  margin-top: 30px;
  font-family: var(--font-heading);
  font-weight: 500;
  letter-spacing: -0.02em;
  line-height: 1.16;
}

.article-body .history-fragment__text--title {
  font-size: 28px;
}

.article-body .history-fragment__text--heading {
  font-size: 24px;
}

.article-body .history-fragment__text--subheading {
  font-size: 20px;
}

.article-body .history-fragment__text--caption {
  color: var(--muted);
  font-size: 12px;
  font-style: italic;
  line-height: 1.4;
}

.article-body .history-fragment--image + .history-fragment--caption {
  margin-top: -2px;
}

.article-body a {
  color: var(--accent);
}

.article-error {
  width: min(520px, calc(100% - 32px));
  margin: 64px auto;
  padding: 22px;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: var(--surface);
  text-align: center;
}

.article-error h2 {
  margin: 0;
  font-family: var(--font-heading);
  font-weight: 500;
  font-size: 24px;
}

.article-error p {
  margin: 9px 0 18px;
  color: var(--muted);
  font-size: 14px;
  line-height: 1.45;
}

.account-scroll {
  min-height: 0;
  overflow-x: hidden;
  overflow-y: auto;
  overscroll-behavior-y: contain;
  -webkit-overflow-scrolling: touch;
  padding: 28px 18px calc(36px + var(--safe-bottom));
}

.payments-panel {
  width: min(540px, 100%);
  margin: 0 auto;
  border: 1px solid var(--line);
  border-radius: 26px;
  padding: 28px 22px 24px;
  background: var(--surface);
  box-shadow: var(--shadow);
}

.paywall-view {
  position: absolute;
  z-index: 12;
  inset: 0;
  display: block;
  background-color: #71849a;
  background-position: center;
  background-repeat: no-repeat;
  background-size: cover;
}

.paywall-view:not([hidden]) {
  background-image: url("/miniapp/icons/paywall-background.png");
}

.paywall-scroll {
  width: 100%;
  height: 100%;
  padding: 0;
  scrollbar-width: none;
}

.paywall-scroll::-webkit-scrollbar {
  display: none;
}

.paywall-panel {
  --paywall-inline: clamp(40px, 13vw, 80px);
  position: relative;
  width: min(100%, 608px, 56.25dvh);
  min-height: var(--tg-viewport-stable-height, 100dvh);
  display: flex;
  flex-direction: column;
  margin: 0 auto;
  padding:
    calc(74px + var(--safe-top))
    var(--paywall-inline)
    calc(148px + var(--safe-bottom));
  overflow: hidden;
  background-position: center top;
  background-repeat: no-repeat;
  background-size: 100% 100%;
  filter: drop-shadow(0 18px 30px rgba(0, 22, 33, 0.24));
  color: var(--text);
  text-align: center;
}

.paywall-view:not([hidden]) .paywall-panel {
  background-image: url("/miniapp/icons/paywall-bookmark.png");
}

.paywall-back {
  position: absolute;
  z-index: 2;
  top: calc(14px + var(--safe-top));
  left: var(--paywall-inline);
  background: color-mix(in srgb, var(--surface) 82%, transparent);
  -webkit-backdrop-filter: blur(10px);
  backdrop-filter: blur(10px);
}

.paywall-hero {
  margin: 0 auto clamp(22px, 4vh, 32px);
}

.account-eyebrow {
  margin: 0 0 7px;
  color: var(--accent);
  font-size: 10px;
  font-weight: 820;
  letter-spacing: 0.12em;
  line-height: 1.2;
  text-transform: uppercase;
}

.payments-panel h1 {
  margin: 0;
  font-family: var(--font-heading);
  font-weight: 500;
  font-size: clamp(29px, 8vw, 42px);
  letter-spacing: -0.035em;
  line-height: 1.04;
}

.paywall-panel .account-eyebrow {
  margin-bottom: 12px;
  font-size: clamp(10px, 2.8vw, 13px);
  font-weight: 500;
  letter-spacing: 0.14em;
}

.paywall-panel h1 {
  max-width: 500px;
  margin: 0 auto;
  font-family: var(--font-heading);
  font-size: clamp(31px, 8.4vw, 50px);
  font-weight: 500;
  letter-spacing: -0.045em;
  line-height: 0.98;
}

.paywall-house {
  position: absolute;
  width: 1px;
  height: 1px;
  margin: -1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
  clip-path: inset(50%);
}

.paywall-copy,
.payments-intro {
  margin: 12px 0 20px;
  color: var(--muted);
  font-size: 14px;
  line-height: 1.55;
}

.paywall-benefits {
  display: grid;
  gap: 10px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.paywall-benefit {
  min-height: 68px;
  display: grid;
  grid-template-columns: 48px minmax(0, 1fr);
  align-items: center;
  gap: 14px;
  border-radius: 18px;
  padding: 8px 12px;
  background: var(--surface);
  color: var(--text);
  text-align: left;
}

.paywall-benefit img {
  width: 48px;
  height: 48px;
  display: block;
  border-radius: 13px;
  object-fit: contain;
  user-select: none;
}

.paywall-benefit span {
  font-size: clamp(14px, 3.7vw, 20px);
  font-weight: 400;
  line-height: 1.13;
}

.paywall-actions {
  width: 100%;
  margin-top: clamp(22px, 3vh, 32px);
  padding-top: 0;
}

.paywall-login {
  width: 100%;
  margin: 11px 0 0;
}

.payment-form-shell {
  width: 100%;
  min-height: 86px;
  margin: 0;
  text-align: left;
}

.payment-form-loading {
  min-height: 86px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  color: var(--muted);
  font-size: 13px;
}

#paper-payment-form,
#paper-payment-form > * {
  max-width: 100%;
}

.primary-action {
  width: 100%;
  min-height: 50px;
  border: 0;
  border-radius: 14px;
  padding: 0 18px;
  background: var(--accent);
  color: var(--accent-text);
  font-size: 15px;
  font-weight: 500;
  cursor: pointer;
}

.secondary-action,
.telegram-action,
.text-action {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 48px;
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 0 18px;
  background: var(--surface-raised);
  color: var(--text);
  font-size: 14px;
  font-weight: 500;
  text-decoration: none;
  cursor: pointer;
}

.paywall-login .secondary-action {
  width: 100%;
  min-height: 50px;
  border-width: 2px;
  background: transparent;
  font-size: 15px;
}

.telegram-action,
.telegram-action:any-link {
  width: 100%;
  border-color: var(--accent);
  background: var(--accent);
  color: var(--accent-text);
  -webkit-text-fill-color: var(--accent-text);
}

.text-action {
  min-height: 38px;
  border: 0;
  background: transparent;
  color: var(--accent);
}

.house-card__action,
.article-error button,
.primary-action,
.telegram-action,
.account-button,
.account-menu > button,
.house-card__close,
.article-back,
.secondary-action,
.text-action,
.dialog-close {
  transition: background-color 140ms ease, border-color 140ms ease, color 140ms ease;
}

@media (hover: hover) {
  .house-card__action:not(:disabled):hover,
  .article-error button:not(:disabled):hover,
  .primary-action:not(:disabled):hover,
  .telegram-action:not(:disabled):hover {
    background: var(--accent-hover);
    color: var(--accent-text);
    -webkit-text-fill-color: var(--accent-text);
  }

  .account-button:not(:disabled):hover,
  .account-menu > button:not(:disabled):hover,
  .house-card__close:not(:disabled):hover,
  .article-back:not(:disabled):hover,
  .secondary-action:not(:disabled):hover,
  .text-action:not(:disabled):hover,
  .dialog-close:not(:disabled):hover {
    background: var(--soft-hover);
  }
}

.house-card__action:not(:disabled):active,
.article-error button:not(:disabled):active,
.primary-action:not(:disabled):active,
.telegram-action:not(:disabled):active {
  background: var(--accent-pressed);
  color: var(--accent-text);
  -webkit-text-fill-color: var(--accent-text);
}

.account-button:not(:disabled):active,
.account-menu > button:not(:disabled):active,
.house-card__close:not(:disabled):active,
.article-back:not(:disabled):active,
.secondary-action:not(:disabled):active,
.text-action:not(:disabled):active,
.dialog-close:not(:disabled):active {
  border-color: var(--line);
  background: var(--soft-pressed);
}

.primary-action:disabled {
  opacity: 0.62;
  cursor: wait;
}

.payment-note {
  margin: 12px 4px 0;
  color: var(--muted);
  font-size: 11px;
  line-height: 1.45;
}

.account-message {
  margin: 14px 0 0;
  border-radius: 12px;
  padding: 10px 12px;
  background: color-mix(in srgb, #b64032 11%, var(--surface));
  color: color-mix(in srgb, #b64032 84%, var(--text));
  font-size: 12px;
  font-weight: 650;
  line-height: 1.4;
}

.payments-panel {
  text-align: left;
}

.payments-loading {
  min-height: 120px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
}

.payments-list {
  display: grid;
  gap: 10px;
}

.payment-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 5px 14px;
  border: 1px solid var(--line);
  border-radius: 15px;
  padding: 14px;
  background: var(--app-bg);
}

.payment-row strong {
  min-width: 0;
  font-size: 14px;
  line-height: 1.35;
}

.payment-row__status {
  align-self: start;
  border-radius: 999px;
  padding: 4px 8px;
  background: var(--soft-accent);
  color: var(--accent);
  font-size: 10px;
  font-weight: 800;
}

.payment-row time,
.payment-row__amount {
  color: var(--muted);
  font-size: 11px;
  line-height: 1.35;
}

.payment-row__amount {
  text-align: right;
}

.payments-empty {
  display: flex;
  flex-direction: column;
  gap: 5px;
  border: 1px dashed var(--line);
  border-radius: 16px;
  padding: 22px 16px;
  color: var(--muted);
  text-align: center;
}

.payments-empty strong {
  color: var(--text);
  font-size: 14px;
}

.payments-empty span {
  font-size: 12px;
  line-height: 1.45;
}

.account-dialog {
  width: min(460px, calc(100vw - 28px));
  max-width: none;
  max-height: min(720px, calc(100dvh - 28px));
  margin: auto;
  border: 0;
  border-radius: 24px;
  padding: 0;
  overflow: auto;
  background: transparent;
  color: var(--text);
  box-shadow: 0 30px 90px rgba(0, 33, 50, 0.3);
}

.account-dialog::backdrop {
  background: rgba(0, 22, 33, 0.58);
  backdrop-filter: blur(5px);
}

.account-dialog__panel {
  position: relative;
  display: grid;
  gap: 14px;
  margin: 0;
  padding: 28px;
  background: var(--surface);
}

.account-dialog__panel h2 {
  margin: -3px 36px 0 0;
  font-family: var(--font-heading);
  font-weight: 500;
  font-size: clamp(28px, 7vw, 38px);
  letter-spacing: -0.03em;
  line-height: 1.05;
}

.dialog-copy {
  margin: -4px 0 4px;
  color: var(--muted);
  font-size: 14px;
  line-height: 1.5;
}

.dialog-close {
  position: absolute;
  top: 14px;
  right: 14px;
  width: 38px;
  height: 38px;
  border: 1px solid var(--line);
  border-radius: 50%;
  background: var(--soft-accent);
  color: var(--text);
  font-size: 25px;
  line-height: 1;
  cursor: pointer;
}

.auth-step {
  display: grid;
  gap: 10px;
}

.auth-step label {
  font-size: 12px;
  font-weight: 780;
}

.auth-step input {
  width: 100%;
  min-height: 50px;
  border: 1px solid var(--line);
  border-radius: 13px;
  padding: 0 14px;
  background: var(--surface-strong);
  color: var(--text);
  font: inherit;
  font-size: 16px;
}

.auth-step input:focus {
  border-color: var(--accent);
  outline: 3px solid var(--surface-highlight);
}

.auth-divider {
  display: flex;
  align-items: center;
  gap: 10px;
  color: var(--muted);
  font-size: 11px;
}

.auth-divider::before,
.auth-divider::after {
  height: 1px;
  flex: 1 1 auto;
  background: var(--line);
  content: "";
}

.link-dialog__mark {
  width: 54px;
  height: 54px;
  display: grid;
  place-items: center;
  border-radius: 18px;
  background: var(--soft-accent);
  color: var(--accent);
  font-size: 27px;
  font-weight: 900;
}

.post-payment-email,
.post-payment-telegram {
  display: grid;
  gap: 10px;
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 14px;
  background: var(--app-bg);
}

.post-payment-email h3,
.post-payment-email p,
.post-payment-telegram p {
  margin: 0;
}

.post-payment-email h3 {
  font-size: 15px;
  line-height: 1.3;
}

.post-payment-email p,
.post-payment-telegram p {
  color: var(--muted);
  font-size: 12px;
  line-height: 1.45;
}

.consumer-notice {
  position: fixed;
  z-index: 90;
  top: max(18px, env(safe-area-inset-top));
  left: 50%;
  width: min(520px, calc(100vw - 32px));
  margin: 0;
  transform: translateX(-50%);
  border: 1px solid var(--line);
  border-radius: 15px;
  padding: 13px 16px;
  background: var(--surface-strong);
  box-shadow: var(--shadow);
  color: var(--text);
  font-size: 14px;
  font-weight: 720;
  line-height: 1.4;
  text-align: center;
}

body[data-paper-surface="web"] .gesture-hint {
  display: none;
}

@media (min-width: 720px) {
  .map-brand {
    top: 20px;
    left: 20px;
    padding: 14px 17px 15px;
  }

  .account-control {
    top: calc(20px + var(--safe-top));
    right: calc(20px + var(--safe-right));
  }

  .gesture-hint {
    top: 20px;
  }

  .house-card {
    right: 20px;
    bottom: 20px;
    left: auto;
    width: min(600px, calc(100vw - 40px));
  }

  .article-body .history-fragment--image {
    margin-right: 0;
    margin-left: 0;
  }

  .article-body .history-fragment__figure img {
    border-radius: 16px;
  }
}

@media (min-width: 960px) and (min-height: 600px) {
  body[data-paper-surface="web"] .house-card-popup.maplibregl-popup {
    z-index: 6;
    max-width: none !important;
  }

  body[data-paper-surface="web"] .house-card-popup .maplibregl-popup-content {
    padding: 0;
    border-radius: 22px;
    background: transparent;
    box-shadow: none;
  }

  body[data-paper-surface="web"] .house-card-popup .maplibregl-popup-tip {
    filter: drop-shadow(0 2px 2px rgba(28, 24, 18, 0.16));
  }

  body[data-paper-surface="web"]
    .house-card-popup.maplibregl-popup-anchor-top
    .maplibregl-popup-tip,
  body[data-paper-surface="web"]
    .house-card-popup.maplibregl-popup-anchor-top-left
    .maplibregl-popup-tip,
  body[data-paper-surface="web"]
    .house-card-popup.maplibregl-popup-anchor-top-right
    .maplibregl-popup-tip {
    border-bottom-color: var(--surface);
  }

  body[data-paper-surface="web"]
    .house-card-popup.maplibregl-popup-anchor-bottom
    .maplibregl-popup-tip,
  body[data-paper-surface="web"]
    .house-card-popup.maplibregl-popup-anchor-bottom-left
    .maplibregl-popup-tip,
  body[data-paper-surface="web"]
    .house-card-popup.maplibregl-popup-anchor-bottom-right
    .maplibregl-popup-tip {
    border-top-color: var(--surface);
  }

  body[data-paper-surface="web"]
    .house-card-popup.maplibregl-popup-anchor-left
    .maplibregl-popup-tip {
    border-right-color: var(--surface);
  }

  body[data-paper-surface="web"]
    .house-card-popup.maplibregl-popup-anchor-right
    .maplibregl-popup-tip {
    border-left-color: var(--surface);
  }

  body[data-paper-surface="web"] .house-card-popup .house-card {
    position: relative;
    inset: auto;
    width: min(600px, calc(100vw - 80px));
    max-width: 600px;
    max-height: min(280px, calc(100dvh - 120px));
    margin: 0;
  }
}

@media (max-width: 380px) {
  .account-dialog {
    width: calc(100vw - 16px);
    max-height: calc(100dvh - 16px);
    border-radius: 20px;
  }

  .account-dialog__panel {
    padding: 24px 18px 20px;
  }

  .paywall-benefit {
    grid-template-columns: 44px minmax(0, 1fr);
    gap: 10px;
    border-radius: 15px;
    padding: 8px 10px;
  }

  .paywall-benefit img {
    width: 44px;
    height: 44px;
    border-radius: 11px;
  }

  .paywall-benefit span {
    font-size: 14px;
  }

  .house-card {
    grid-template-columns: 104px minmax(0, 1fr);
  }

  .house-card__media,
  .house-card__media picture,
  .house-card__media img {
    min-height: 164px;
  }

  .house-card__content {
    padding: 14px 12px 12px;
  }

  .house-card h2 {
    font-size: 17px;
  }

  .house-card__action {
    min-height: 38px;
    font-size: 13px;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    animation-duration: 1ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 1ms !important;
  }
}
