:root {
  color-scheme: dark;
  --bg: #414cff;
  --page-bg: #000000;
  --app-bg: #18191b;
  --panel: #2b2c30;
  --panel-soft: rgba(255, 255, 255, 0.12);
  --text: #ffffff;
  --muted: rgba(255, 255, 255, 0.58);
  --accent: #d86bff;
  --line: rgba(255, 255, 255, 0.16);
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  min-height: 100%;
  overflow-x: hidden;
  background: var(--page-bg);
  color: var(--text);
  font-family: -apple-system, BlinkMacSystemFont, "SF Pro Display", "SF Pro Text", system-ui, sans-serif;
}

button,
input,
select {
  font: inherit;
  touch-action: manipulation;
}

button {
  border: 0;
  color: inherit;
}

.app-shell {
  min-height: 100vh;
  min-height: 100dvh;
  position: relative;
  padding: 0 18px;
  background: var(--app-bg);
  overflow: visible;
}

.tab-screen {
  display: none;
  min-height: 100vh;
  min-height: 100dvh;
  padding-bottom: calc(env(safe-area-inset-bottom) + 116px);
  overflow: visible;
}

.tab-screen.is-active {
  display: block;
}

.tab-screen--search {
  margin: 0 -18px;
  padding: 0 18px calc(env(safe-area-inset-bottom) + 116px);
  background: var(--app-bg);
}

.tab-screen--page {
  padding-top: 74px;
}

.tab-screen--delivery {
  height: 100vh;
  height: 100dvh;
  min-height: 0;
  padding-top: 0;
  padding-bottom: 0;
  overflow: hidden;
}

.delivery-scroll {
  height: 100%;
  overflow-x: hidden;
  overflow-y: auto;
  padding-top: 24px;
  padding-bottom: calc(env(safe-area-inset-bottom) + 116px);
  overscroll-behavior-y: contain;
  -webkit-overflow-scrolling: touch;
}

.tab-screen--orders {
  padding-top: 42px;
}

.hero-section {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding-top: 46px;
  padding-bottom: 54px;
}

.hero-section h1 {
  margin: 88px 0 42px;
  text-align: center;
  font-size: clamp(26px, 7vw, 34px);
  line-height: 1.02;
  letter-spacing: 0;
  font-weight: 650;
}

.search-form {
  position: relative;
  width: min(92%, 344px);
  transition: width 180ms ease;
}

.search-form:focus-within {
  width: min(100%, 368px);
}

.search-form input {
  width: 100%;
  height: 52px;
  padding: 0 66px 0 20px;
  color: var(--text);
  background: rgba(255, 255, 255, 0.12);
  border: 1px solid rgba(255, 255, 255, 0.24);
  border-radius: 999px;
  outline: none;
  font-size: 18px;
  font-weight: 400;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.1);
}

.search-form input:focus {
  background: rgba(255, 255, 255, 0.12);
  border-color: rgba(255, 255, 255, 0.24);
}

.search-form input::placeholder {
  color: rgba(255, 255, 255, 0.46);
}

.send-button {
  position: absolute;
  top: 5px;
  right: 5px;
  display: grid;
  place-items: center;
  width: 48px;
  height: 42px;
  background: rgba(255, 255, 255, 0.06);
  border-radius: 999px;
}

.send-button svg {
  width: 24px;
  height: 24px;
  stroke: rgba(255, 255, 255, 0.28);
  stroke-width: 2.5;
  stroke-linecap: round;
  stroke-linejoin: round;
  fill: none;
}

.search-form:focus-within .send-button {
  background: var(--tg-theme-button-color, var(--tg-theme-link-color, var(--accent)));
}

.search-form:focus-within .send-button svg {
  stroke: var(--tg-theme-button-text-color, #ffffff);
}

.how-link {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  margin-top: 12px;
  padding: 0;
  color: var(--tg-theme-link-color, var(--accent));
  background: transparent;
  font-size: 14px;
  line-height: 1;
  font-weight: 400;
}

.how-link svg {
  width: 7px;
  height: 12px;
  overflow: visible;
  stroke: currentColor;
  stroke-width: 1.55;
  stroke-linecap: round;
  stroke-linejoin: round;
  fill: none;
}

.main-section {
  margin-top: 24px;
}

.main-section h2 {
  margin: 0 0 10px;
  padding-left: 18px;
  font-size: 20px;
  line-height: 1;
  letter-spacing: 0;
  font-weight: 650;
}

.placeholder-card {
  display: grid;
  grid-template-columns: 46px 1fr;
  gap: 14px;
  align-items: center;
  min-height: 82px;
  padding: 16px 18px;
  background: var(--panel);
  border-radius: 24px;
}

.card-icon {
  display: grid;
  place-items: center;
  width: 38px;
  height: 38px;
  font-size: 24px;
}

.placeholder-card h3 {
  margin: 0;
  font-size: 19px;
  line-height: 1.12;
  font-weight: 800;
}

.placeholder-card p {
  margin: 6px 0 0;
  color: var(--muted);
  font-size: 15px;
  line-height: 1.22;
  font-weight: 650;
}

.amount-hero {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 16px;
  padding: 12px 0 42px;
}

.amount-row {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 58px;
}

.amount-row--delivery {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr);
  width: 100%;
  column-gap: 8px;
}

.amount-row--delivery .amount-value {
  grid-column: 2;
}

.amount-row--delivery .amount-currency {
  grid-column: 3;
  justify-self: start;
}

.amount-value {
  font-size: 42px;
  line-height: 1;
  font-weight: 720;
  letter-spacing: 0;
}

.amount-value--empty {
  color: rgba(255, 255, 255, 0.32);
}

.amount-currency {
  color: rgba(255, 255, 255, 0.58);
  font-size: 28px;
  line-height: 1;
  font-weight: 700;
}

.inline-link {
  padding: 0;
  background: transparent;
  color: var(--tg-theme-link-color, var(--accent));
  font-size: 17px;
  line-height: 1;
  font-weight: 600;
}

.amount-note {
  min-height: 16px;
  margin-top: -8px;
  color: rgba(255, 255, 255, 0.44);
  font-size: 14px;
  line-height: 1;
  font-weight: 400;
  text-align: center;
}

.amount-link {
  margin-top: 0;
}

.delivery-sheet {
  position: fixed;
  inset: 0;
  z-index: 60;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  padding: 0;
  background-color: rgba(0, 0, 0, 0.42);
  visibility: visible;
  pointer-events: auto;
  transition: background-color 420ms ease, visibility 0s linear;
}

.delivery-sheet.hidden {
  background-color: rgba(0, 0, 0, 0);
  visibility: hidden;
  pointer-events: none;
  transition: background-color 420ms ease, visibility 0s linear 420ms;
}

.delivery-sheet__card {
  position: relative;
  width: 100%;
  max-width: none;
  padding: 32px 58px max(30px, calc(env(safe-area-inset-bottom) + 28px));
  background: var(--panel);
  border-radius: 34px 34px 0 0;
  box-shadow: 0 18px 48px rgba(0, 0, 0, 0.45);
  display: flex;
  flex-direction: column;
  transform: translateY(0);
  transition: transform 420ms cubic-bezier(0.22, 1, 0.36, 1);
  will-change: transform;
}

.delivery-sheet.hidden .delivery-sheet__card {
  transform: translateY(100%);
  transition-duration: 420ms;
  transition-timing-function: cubic-bezier(0.32, 0, 0.67, 0);
}

.delivery-sheet__close {
  position: absolute;
  top: 14px;
  right: 14px;
  width: 34px;
  height: 34px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.09);
  color: rgba(255, 255, 255, 0.82);
  font-size: 25px;
  line-height: 1;
}

.delivery-sheet__title {
  margin: 0 0 26px;
  color: var(--text);
  font-size: 23px;
  line-height: 1.05;
  font-weight: 650;
  text-align: center;
  white-space: nowrap;
}

.delivery-sheet__copy {
  display: grid;
  gap: 8px;
  color: rgba(255, 255, 255, 0.72);
  font-size: 16px;
  line-height: 1.24;
  font-weight: 400;
  padding-left: 14px;
}

.delivery-sheet__copy p {
  margin: 0;
}

.delivery-sheet__action {
  align-self: center;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  margin-top: 26px;
  padding: 0;
  background: transparent;
  color: var(--tg-theme-link-color, var(--accent));
  font-size: 14px;
  line-height: 1;
  font-weight: 400;
}

.delivery-sheet__action svg {
  width: 7px;
  height: 12px;
  overflow: visible;
  stroke: currentColor;
  stroke-width: 1.55;
  stroke-linecap: round;
  stroke-linejoin: round;
  fill: none;
}

.stack {
  display: grid;
  gap: 8px;
}

.rate-card,
.converter-card,
.data-card {
  background: var(--panel);
  border-radius: 28px;
}

.rate-card {
  min-height: 76px;
  padding: 20px 22px;
  display: grid;
  grid-template-columns: 1fr auto;
  align-items: center;
  gap: 16px;
}

.rate-title,
.rate-value {
  color: var(--text);
  font-size: 21px;
  line-height: 1.08;
  font-weight: 680;
}

.converter-card {
  padding: 10px 22px;
}

.converter-row {
  display: grid;
  grid-template-columns: 1fr auto;
  align-items: center;
  min-height: 74px;
  gap: 18px;
}

.converter-row span,
.data-row span {
  display: block;
  color: rgba(255, 255, 255, 0.58);
  font-size: 16px;
  line-height: 1.1;
  font-weight: 560;
}

.converter-row strong {
  display: block;
  margin-top: 10px;
  color: var(--text);
  font-size: 23px;
  line-height: 1;
  font-weight: 680;
}

.converter-row b {
  color: rgba(255, 255, 255, 0.46);
  font-size: 30px;
  line-height: 1;
  font-weight: 680;
}

.converter-divider {
  height: 1px;
  width: calc(100% - 28px);
  margin: 0 0 0 auto;
  background: rgba(255, 255, 255, 0.12);
}

.data-card {
  padding: 4px 22px;
}

.data-row {
  position: relative;
  display: grid;
  grid-template-columns: max-content minmax(0, 1fr);
  align-items: center;
  min-height: 54px;
  gap: 10px;
  justify-items: stretch;
}

.data-row:not(:last-child)::after {
  content: "";
  position: absolute;
  right: 0;
  bottom: 0;
  left: 0;
  height: 1px;
  background: rgba(255, 255, 255, 0.12);
}

.data-row span {
  color: var(--text);
  font-size: 17px;
  font-weight: 500;
  white-space: nowrap;
}

.data-row select,
.data-row input {
  width: 100%;
  min-width: 0;
  justify-self: stretch;
  padding: 0 17px 0 0;
  border: 0;
  outline: 0;
  appearance: none;
  background: transparent;
  color: rgba(255, 255, 255, 0.58);
  line-height: 1;
  font-weight: 500;
  text-align: right;
  text-align-last: right;
}

.data-row input {
  font-size: 21px;
}

.data-row input::placeholder {
  color: transparent;
}

.data-row.has-value select,
.data-row.has-value input,
.data-row.is-focused select,
.data-row.is-focused input {
  padding-right: 0;
}

.data-row__chevron {
  position: absolute;
  top: 50%;
  right: 0;
  width: 7px;
  height: 12px;
  overflow: visible;
  transform: translateY(-50%);
  stroke: rgba(255, 255, 255, 0.58);
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
  fill: none;
  transition: opacity 0.16s ease;
}

.data-row.has-value .data-row__chevron,
.data-row.is-focused .data-row__chevron {
  opacity: 0;
  pointer-events: none;
}

.page-title {
  margin: 0 0 30px;
  color: var(--text);
  font-size: 28px;
  line-height: 1;
  letter-spacing: 0;
  font-weight: 850;
  text-align: center;
}

.orders-switch {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  margin-bottom: 24px;
}

.orders-switch-button {
  padding: 6px 11px 7px;
  background: transparent;
  border-radius: 999px;
  color: rgba(255, 255, 255, 0.54);
  font-size: 13px;
  line-height: 1;
  font-weight: 800;
}

.orders-switch-button.is-active {
  background: rgba(255, 255, 255, 0.1);
  color: var(--text);
}

.orders-empty {
  display: grid;
  place-items: center;
  width: 100%;
  aspect-ratio: 1;
  margin: 0 auto;
  background: rgba(255, 255, 255, 0.045);
  border: 0;
  border-radius: 32px;
  color: rgba(255, 255, 255, 0.28);
  font-size: 22px;
  line-height: 1;
  font-weight: 760;
  letter-spacing: 0;
}

.orders-list {
  display: grid;
  gap: 12px;
}

.order-card {
  width: 100%;
  padding: 16px 18px 18px;
  background: var(--panel);
  border-radius: 28px;
  color: var(--text);
}

.order-card__top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  font-size: 18px;
  line-height: 1;
  font-weight: 640;
}

.order-card__top strong {
  font-weight: inherit;
}

.order-card__amount {
  flex: 0 0 auto;
  font-size: 20px;
  line-height: 1;
  font-weight: 640;
}

.order-card__divider {
  width: calc(100% - 14px);
  height: 1px;
  margin: 12px auto 0;
  background: rgba(255, 255, 255, 0.12);
}

.order-card__body {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 12px;
  min-height: 46px;
  margin-top: 12px;
}

.order-card__date {
  font-size: 14px;
  line-height: 1;
  font-weight: 560;
  color: rgba(255, 255, 255, 0.5);
}

.order-card__actions {
  display: inline-flex;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
  margin-left: auto;
  transform: translateY(2px);
}

.order-card__button {
  appearance: none;
  border: 1px solid rgba(255, 255, 255, 0.18);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.035);
  color: #ffffff;
  padding: 8px 12px;
  font: inherit;
  font-size: 13px;
  line-height: 1;
  font-weight: 560;
  letter-spacing: 0;
}

.order-card--completed .order-card__top,
.order-card--completed .order-card__divider,
.order-card--completed .order-card__date,
.order-card--completed .order-card__button:disabled {
  opacity: 0.36;
}

.order-card__button:disabled {
  pointer-events: none;
}

.bottom-tabs {
  position: fixed;
  left: 18px;
  right: 18px;
  bottom: calc(env(safe-area-inset-bottom) + 12px);
  z-index: 20;
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  align-items: center;
  max-width: 394px;
  height: 72px;
  margin: 0 auto;
  padding: 5px;
  background: rgba(36, 37, 41, 0.86);
  border: 1px solid rgba(255, 255, 255, 0.13);
  border-radius: 999px;
  box-shadow:
    0 18px 42px rgba(0, 0, 0, 0.34),
    inset 0 1px 0 rgba(255, 255, 255, 0.08);
  backdrop-filter: blur(18px);
  transform: translateY(0);
  transition: transform 420ms cubic-bezier(0.22, 1, 0.36, 1) 420ms;
  will-change: transform;
}

body.keyboard-open .bottom-tabs,
body.sheet-open .bottom-tabs,
body:has(#deliveryWeight:focus) .bottom-tabs,
body:has(#deliveryVolume:focus) .bottom-tabs {
  pointer-events: none;
  transform: translateY(calc(100% + 24px));
  transition-delay: 0ms;
}

.tab-button {
  display: grid;
  grid-template-rows: 25px 13px;
  place-items: center;
  align-content: center;
  gap: 3px;
  min-width: 0;
  height: 60px;
  padding: 0 4px;
  background: transparent;
  border-radius: 999px;
  color: rgba(255, 255, 255, 0.78);
}

.tab-button.is-active {
  color: var(--accent);
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.2), rgba(255, 255, 255, 0.12));
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.12);
}

.tab-button svg {
  width: 25px;
  height: 25px;
  display: block;
  stroke: currentColor;
  stroke-width: 1.9;
  stroke-linecap: round;
  stroke-linejoin: round;
  fill: none;
}

.tab-icon-mask {
  display: block;
  width: 25px;
  height: 25px;
  background: currentColor;
  -webkit-mask: center / contain no-repeat;
  mask: center / contain no-repeat;
}

.tab-icon-mask--search {
  -webkit-mask-image: url("../assets/search-tab.png");
  mask-image: url("../assets/search-tab.png");
}

.tab-button svg.tab-fill-icon {
  width: 22px;
  height: 22px;
  stroke: none;
  fill: currentColor;
}

.tab-button span {
  max-width: 100%;
  overflow: hidden;
  color: currentColor;
  font-size: 13px;
  line-height: 1;
  font-weight: 500;
  letter-spacing: 0;
  text-overflow: ellipsis;
  white-space: nowrap;
}

@media (min-width: 520px) {
  body {
    display: grid;
    place-items: start center;
  }

  .app-shell {
    width: 430px;
  }
}
