:root {
  --tg-theme-bottom-bar-bg-color: red;
  --tg-theme-section-separator-color: green;
  --tg-color-scheme: dark;
  --tg-theme-bg-color: #212121;
  --tg-theme-button-color: #8774e1;
  --tg-theme-button-text-color: #ffffff;
  --tg-theme-hint-color: #aaaaaa;
  --tg-theme-link-color: #8774e1;
  --tg-theme-secondary-bg-color: #181818;
  --tg-theme-text-color: #ffffff;
  --tg-theme-header-bg-color: #212121;
  --tg-theme-accent-text-color: #8774e1;
  --tg-theme-section-bg-color: #212121;
  --tg-theme-section-header-text-color: #8774e1;
  --tg-theme-subtitle-text-color: #aaaaaa;
  --tg-theme-destructive-text-color: #ff595a;
  --tg-viewport-height: 100vh;
  --tg-viewport-stable-height: 100vh;

  --font-size: 16px;
  --font-size-medium: 24px;
  --font-size-large: 32px;
  --input-width: 100px;
  --input-width-medium: 200px;
  --input-width-large: 300px;
  --border-radius: 5px;

  --gap: 8px;
  --gap-small: 8px;
  --gap-median: 16px;
  --gap-large: 24px;
  --gap-gallery: 1px;
}

body {
  font-family: var(--default-font);
  font-size: var(--font-size);
  line-height: 16px;
  font-weight: 400;
  background-color: var(--bg-color);
  color: var(--text-color);
  color-scheme: var(--tg-color-scheme);
  margin: 0;
  padding: 0;
  width: 1px;
  min-width: 100%;

  --default-font: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif, 'Apple Color Emoji', 'Segoe UI Emoji', 'Segoe UI Symbol';
  --block-bg-color: var(--tg-theme-bg-color);
  --bg-color: var(--tg-theme-secondary-bg-color, #ebedf0);
  --animation: .15s ease;
  --page-animation-duration: .3s;
  --page-animation: var(--page-animation-duration) ease;
  --status-height: 48px;
  --accent-color: #31b545;
  --main-color: #f8a917;
  --text-color: var(--tg-theme-text-color);
  --page-hint-color: #83878a;
  --hint-color: #74787a;
  --placeholder-color: #999da1;
  --ripple-duration: .45s;
  --ripple-end-duration: .3s;
  -webkit-user-select: none;
  user-select: none;
  cursor: default;
}

html.dark body {
  --block-bg-color: var(--tg-theme-bg-color);
  --bg-color: var(--tg-theme-secondary-bg-color, #0f0f0f);
  --text-color: #fff;
  --page-hint-color: #9b9ba1;
  --hint-color: #64666d;
  --placeholder-color: #5d6163;
}

body.order-mode {
  background-color: var(--bg-color);
}

* {
  -webkit-tap-highlight-color: transparent;
}

h1,
h2,
h3,
h4,
h5,
h6 {
  margin: 0;
}

h1 {
  margin: 0;
  padding: var(--gap-median) 0;
  font-size: 2em;
}

p {
  margin: 0;
}

.page {
  transition: filter var(--animation);
  display: flex;
  flex-direction: column;
  gap: var(--gap-small) 0;
}

body.closed .cafe-page {
  filter: grayscale(1) opacity(0.7);
}

a {
  color: var(--tg-theme-link-color);
  text-decoration-line: none;
}

a:visited {
  color: var(--tg-theme-link-color);
  text-decoration-line: none;
}

.hint {
  font-family: var(--default-font);
  font-size: 14px;
  line-height: 18px;
  -webkit-font-smoothing: antialiased;
  color: var(--hint-color);
}

input {
  border: none;
}

select {
  border: none;
}

hr {
  margin: 0;
}

.hidden {
  display: none !important;
}

#header {
  display: flex;
  flex-direction: column;
  gap: var(--gap-small) 0;
}

#title {
  padding-bottom: 0px;
  padding: var(--gap-median) 0 0 var(--gap-median);
}

#subtitle {
  padding: var(--gap-small) 0 0 var(--gap-median);
  margin: 0px;
  font-size: 14px;
}

.section_header {
  color: var(--tg-theme-section-header-text-color);
  font-size: 18px;
  padding: var(--gap-small) 0 0 var(--gap-median);
}

fieldset {
  border: none;
  padding: 0;
  margin: 0;
}

legend {
  padding: var(--gap-small) 0;
}

#filter-form legend {
  color: var(--tg-theme-section-header-text-color);
  font-size: 14px;
  padding: 0 0 var(--gap-small) 0;
  width: 100%;
}

#filter-area-range-set {
  padding-bottom: var(--gap-small);
}

#filter-price-range-set {
  padding-bottom: var(--gap-small);
}

#filter-location-set {
  padding-bottom: var(--gap-small);
}

.filter-field {
  font-size: var(--font-size);
  width: var(--input-width);
  padding: 5px;
  border-radius: var(--border-radius);
  border: 1px solid #8f8f9d;
}

#filter-type-cbox-set {
  display: flex;
  flex-direction: column;
  gap: var(--gap-small) 0;
}

#floorplan-wrap {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr 1fr;
  height: min-content;
  gap: var(--gap-small);
}

#filter-type-cbox-set label {
  display: flex;
  align-items: center;
  flex-basis: 25%;
}

#floorplan-long-wrap {
  display: flex;
  flex-direction: row;
  flex-wrap: wrap;
  gap: calc(var(--gap-small)/3);
  width: 100%;
}

#checkbox-set-wrap {
  padding-bottom: var(--gap-small);
}

#location {
  width: 100%;
}

#menu {
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: row;
  width: 100%;
  justify-content: space-around;
}

#menu a {
  display: inline-block;
  padding: var(--gap-small) var(--gap-large);
}

#main {
  display: flex;
  flex-direction: column;
  gap: var(--gap-small) 0;
}

#subscription-message {
  display: flex;
  flex-direction: column;
  padding: 0 var(--gap-median) var(--gap-small) var(--gap-median);
}

.section {
  background-color: var(--tg-theme-section-bg-color);
  -webkit-box-shadow: 0 0.5px rgba(0, 0, 0, .07);
  box-shadow: 0 0.5px rgba(0, 0, 0, .07);
  padding: var(--gap-small) var(--gap-median);
}

.block {
  padding: var(--gap-small);
  width: calc(100% - 2*var(--gap-small));
}

#subs-block {
  display: flex;
  flex-direction: column;
  border-radius: var(--gap-median);
  background-color: var(--tg-theme-section-bg-color);
  gap: var(--gap-small);
}

.subs-item {
  display: flex;
  flex-direction: row;
  flex-wrap: nowrap;
  align-items: center;
  justify-content: space-between;
}

.section-separator {
  background-color: var(--hint-color);
}

#remove-button {
  padding-top: calc(var(--gap-large) - 2);
  padding-bottom: calc(var(--gap-large) - 2);
  padding-left: var(--gap-large);
  padding-right: var(--gap-large);
  aspect-ratio: 1;
  width: 100%;
  background-color: unset;
  border: 1px solid var(--hint-color);
  border-radius: 2px;
}

.green-icon {
  fill: green;
  color: green;
}

.red-icon {
  fill: red;
  color: red;
}

#message-icon {
  display: inline-block;
  width: 36px;
  height: 36px;
  position: relative;
  top: calc((36px - 0.698em) / 2);
  line-height: 36px;
  vertical-align: baseline;
}

#message-text-align {
  display: inline-block;
  width: 100%;
  line-height: 36px;
  height: 36px;
  padding-bottom: 0.698em;
}

.subs-list-cell {
  vertical-align: baseline;
  word-break: break-all;
}

.subs-list-cell img {
  height: 18px;
  width: 18px;
  /* This is --page-hint-color */
  /* Filter can be update with https://codepen.io/sosuke/pen/Pjoqqp */
  filter: invert(57%) sepia(6%) saturate(241%) hue-rotate(163deg) brightness(93%) contrast(85%);
}

.subs-text-align {
  display: inline-block;
  padding-bottom: 0.052em;
  width: 100%;
  line-height: 20px;
}

.subs-item-props-icon {
  display: inline-block;
  width: 18px;
  height: 18px;
  position: relative;
  top: calc((18px - 0.698em) / 2);
}

#footer-block {
  padding: var(--gap-small) var(--gap-median);
}

.charts-wrap {
  display: flex;
  flex-direction: column;
  gap: var(--gap-small);
  padding: var(--gap-small);
}

.chart {
  max-width: calc(var(--width) / 2 - var(--gap-small)*2);
  width: 100%;
}

.stats-block-header {
  font-size: 18px;
  line-height: 42px;
  text-transform: uppercase;
  padding: 0;
  margin: 0;
}

.stats table tr {
  line-height: 20px;
}

.stats-name {
  color: var(--tg-theme-hint-color);
}

.stats-value {}

#map {
  height: 300px;
}

#districts-table {
  padding-top: var(--gap-small);
}

#no-telegram {
  width: 100%;
  height: 200px;
  text-align: center;
  vertical-align: middle;
  line-height: 200px;
}

/* Range slider START */
.ui-slider-horizontal {
  height: .6em;
}

.ui-slider-horizontal {
  margin-bottom: 15px;
}

.ui-widget-header {
  background: var(--tg-theme-section-header-text-color);
}

.ui-slider-handle.ui-corner-all.ui-state-default {
  background: var(--tg-theme-section-bg-color);
}

#price-slider-range {
  max-width: 90vw;
}

.slider-wrap {
  max-width: calc(2*var(--input-width) + 4ch);
}

/* Range slider END */

/* Animations */
.fadein {
  animation: 0.1s linear 0s 1 normal fadeIn;
}

@keyframes fadeIn {
  from {
    opacity: 0;
  }

  to {
    opacity: 1;
  }
}

/* Animations END */

#image-gallery {
  display: flex;
  flex-direction: row;
  gap: var(--gap-gallery);
  flex-wrap: wrap;
  width: 100%;
}

#image-gallery a {
  border: none;
  height: 250px;
  width: 250px;
  /* 4 px is 1 px gap for 2 images on both sides */
  max-width: calc(50vw - var(--gap-gallery));
  max-height: calc(50vw - var(--gap-gallery));
  aspect-ratio: 1;
}

#image-gallery img {
  object-fit: cover;
  max-width: calc(50% - var(--gap-gallery));
  max-height: 100%;
  aspect-ratio: 1;
  height: auto;
}

#advert-table-container {
  padding: var(--gap-small);
}

#advert-table {
  border-collapse: collapse;
  width: 100%;
}

#advert-table td {
  vertical-align: top;
}

#advert-table > tbody td:nth-child(1) {
  white-space: nowrap;
}

#advert-table > tbody td:nth-child(2) {
  padding-left: var(--gap-small);
}

