﻿:root {
  --bg: #0f7d95;
  --panel: #fffdf8;
  --panel-strong: #ffffff;
  --ink: #23231f;
  --muted: #767166;
  --line: #ded8cc;
  --brand: #12363d;
  --brand-2: #008fa8;
  --brand-soft: #d8f2ed;
  --amber: #ad7017;
  --amber-soft: #ffbe35;
  --blue: #087dba;
  --blue-soft: #2ec4d6;
  --green: #2f6b4f;
  --green-soft: #79d4af;
  --coral: #f35f47;
  --coral-soft: #ff947a;
  --violet: #a56580;
  --sand: #ffd577;
  --gray-soft: #ece9e2;
  --danger: #9e3d36;
  --danger-soft: #f2dddd;
  --shadow: 0 18px 45px rgba(35, 35, 31, 0.1);
  --nav-icon: #767166;
  --app-gradient:
    linear-gradient(145deg, rgba(255, 255, 255, 0.92) 0%, rgba(224, 231, 228, 0.96) 42%, rgba(198, 207, 203, 0.96) 66%, rgba(247, 249, 245, 0.94) 100%);
  --active-button-gradient:
    linear-gradient(145deg, #8d9693 0%, #66716f 42%, #9ba39f 68%, #56615f 100%);
  --active-button-shadow:
    inset 1px 1px 0 rgba(255, 255, 255, 0.24),
    inset -8px -8px 14px rgba(0, 0, 0, 0.12),
    5px 5px 0 rgba(18, 54, 61, 0.12),
    0 14px 28px rgba(18, 54, 61, 0.12);
  font-family: Roboto, "Segoe UI", Arial, sans-serif;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-width: 0;
  padding-top: env(safe-area-inset-top);
  background: #fff;
  color: var(--ink);
  font-family: Roboto, "Segoe UI", Arial, sans-serif;
}

button,
input,
select,
textarea {
  font: inherit;
}

button {
  cursor: pointer;
}

a {
  color: inherit;
}

.hidden {
  display: none !important;
}

.app-splash {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: grid;
  place-items: center;
  overflow: hidden;
  background: #fff;
}

.app-splash.hidden {
  opacity: 0;
  pointer-events: none;
}

/* Сплэш уходил мгновенной подменой кадра. Плавный уход даёт карте под ним
   дочитаться и превращает исчезновение в переход, а не в рывок. */
.app-splash {
  transition: opacity 320ms ease;
}

.app-splash-tiles {
  position: absolute;
  inset: 0;
  width: min(100%, 430px);
  margin: 0 auto;
  pointer-events: none;
}

.splash-tile {
  position: absolute;
  display: grid;
  width: 68px;
  height: 68px;
  place-items: center;
  padding: 8px;
  border-radius: 8px;
  color: #fff;
  opacity: 0.28;
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.58),
    5px 5px 0 rgba(18, 54, 61, 0.07);
}

.splash-tile svg {
  width: 48px;
  height: 48px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.9;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.splash-ticket {
  top: 12%;
  right: 8%;
  background: #65c7a0;
}

.splash-food {
  top: 31%;
  right: 18%;
  background: #f35f47;
}

.splash-place {
  top: 51%;
  right: 10%;
  background: #16a1be;
}

.splash-spa {
  top: 68%;
  right: 30%;
  background: #a56580;
}

.splash-excursion {
  top: 81%;
  right: 13%;
  background: #ff8f3d;
}

.app-splash-card {
  position: relative;
  z-index: 1;
  display: grid;
  justify-items: center;
  gap: 24px;
  transform: translateY(-4vh);
}

.app-splash-card h1 {
  width: 260px;
  margin: 0;
  color: #043f53;
  font-size: 26px;
  font-weight: 900;
  letter-spacing: 0;
  line-height: 1;
  text-align: center;
}

.app-splash-card img {
  width: 190px;
  height: 190px;
  object-fit: contain;
  filter: drop-shadow(5px 5px 0 rgba(18, 54, 61, 0.08));
}

.app-splash-card p {
  max-width: 280px;
  margin: -10px 0 0;
  color: var(--muted);
  font-size: 14px;
  font-weight: 800;
  line-height: 1.28;
  text-align: center;
}

.intro-screen {
  position: relative;
  display: grid;
  width: min(100%, 760px);
  min-height: 100vh;
  margin: 0 auto;
  padding: 24px 20px;
  place-items: center;
  overflow: hidden;
  background: #fff;
}

.intro-floaters {
  position: absolute;
  inset: 0;
  overflow: hidden;
  pointer-events: none;
}

.intro-floater {
  position: absolute;
  top: -120px;
  right: 7%;
  display: grid;
  width: 66px;
  height: 66px;
  place-items: center;
  padding: 8px;
  border-radius: 8px;
  color: #fff;
  opacity: 0.3;
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.58),
    5px 5px 0 rgba(18, 54, 61, 0.07);
  animation: intro-float 13s linear infinite;
}

.intro-floater svg {
  width: 46px;
  height: 46px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.9;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.floater-ticket {
  right: 8%;
  background: #65c7a0;
  animation-delay: -1s;
}

.floater-food {
  right: 26%;
  background: #f35f47;
  animation-delay: -3s;
}

.floater-place {
  right: 13%;
  background: #16a1be;
  animation-delay: -5s;
}

.floater-spa {
  right: 31%;
  background: #a56580;
  animation-delay: -7s;
}

.floater-excursion {
  right: 19%;
  background: #ff8f3d;
  animation-delay: -8.5s;
}

.floater-stay {
  right: 5%;
  background: #ffbe35;
  animation-delay: -10s;
}

.floater-idea {
  right: 28%;
  background: #7fb088;
  animation-delay: -11.5s;
}

.floater-shopping {
  right: 14%;
  background: #2ec4d6;
  animation-delay: -12.5s;
}

@keyframes intro-float {
  from {
    transform: translateY(0) rotate(-2deg);
  }

  to {
    transform: translateY(calc(100vh + 240px)) rotate(2deg);
  }
}

.intro-card {
  position: relative;
  z-index: 1;
  display: grid;
  width: min(100%, 390px);
  min-height: 620px;
  grid-template-rows: 26px 178px 250px 76px;
  align-content: center;
  justify-items: center;
  justify-content: center;
  gap: 12px;
  text-align: center;
}

.intro-logo {
  width: 178px;
  height: 178px;
  object-fit: contain;
  filter: drop-shadow(5px 5px 0 rgba(18, 54, 61, 0.08));
  transform: translateY(10px);
}

.intro-card .intro-title-brand {
  width: 240px;
  color: #043f53;
  font-size: 23px;
  font-weight: 900;
  letter-spacing: 0;
  line-height: 1;
  text-align: center;
}

.intro-card h1 {
  justify-self: center;
  max-width: 220px;
  color: var(--ink);
  font-size: 29px;
  line-height: 1.08;
  text-align: center;
}

.intro-card p {
  display: grid;
  width: 280px;
  justify-self: center;
  align-self: start;
  gap: 2px;
  margin: 20px 0 0;
  color: var(--ink);
  font-size: 17px;
  font-weight: 500;
  line-height: 1.15;
  text-align: center;
}

.intro-card p span {
  white-space: nowrap;
}

.intro-card-wide p {
  width: 360px;
  max-width: calc(100vw - 36px);
}

.intro-card-wide p span {
  white-space: normal;
}

.intro-copy-break {
  margin-top: 14px;
}

.intro-button {
  justify-self: center;
  align-self: end;
  min-width: 164px;
  min-height: 54px;
  padding: 0 26px;
  border: 1px solid rgba(255, 255, 255, 0.74);
  border-radius: 8px;
  background:
    linear-gradient(145deg, rgba(255, 255, 255, 0.7), rgba(255, 255, 255, 0.28) 44%, rgba(18, 54, 61, 0.12)),
    rgba(255, 255, 255, 0.36);
  color: var(--ink);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.82),
    inset 0 -8px 14px rgba(18, 54, 61, 0.08),
    5px 5px 0 rgba(18, 54, 61, 0.1),
    0 14px 24px rgba(18, 54, 61, 0.12);
  font-size: 23px;
  font-weight: 400;
}

.intro-button:active {
  transform: translateY(1px);
}

@media (prefers-reduced-motion: reduce) {
  .intro-floater {
    animation: none;
    display: none;
  }
}

.home-screen {
  width: min(100%, 760px);
  min-height: 100vh;
  margin: 0 auto;
  padding: 0 14px 112px;
  background: #fff;
}

.home-header {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 40px;
  align-items: center;
  gap: 12px;
  margin: 0 -14px 16px;
  padding: 16px 14px 18px;
  background:
    var(--app-gradient),
    var(--panel);
  border-bottom: 1px solid rgba(222, 216, 204, 0.8);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.85),
    inset 0 -10px 18px rgba(18, 54, 61, 0.05),
    0 6px 0 rgba(18, 54, 61, 0.1),
    0 18px 34px rgba(18, 54, 61, 0.12);
}

.home-share-button {
  flex: 0 0 40px;
}

.home-language-switch {
  display: flex;
  width: max-content;
  margin: var(--a-gap) 16px 4px auto;
  align-items: center;
}

.home-language-option {
  position: relative;
  display: grid;
  width: 40px;
  min-width: 40px;
  min-height: 38px;
  place-items: center;
  padding: 0;
  border: 1px solid var(--a-line);
  border-radius: 0;
  background: transparent;
  color: var(--a-ink-soft);
  font-size: 12px;
  font-weight: 700;
  line-height: 1;
}

.home-language-option:first-child {
  border-radius: 8px 0 0 8px;
}

.home-language-option:first-child[aria-pressed="false"] {
  color: var(--blue);
}

.home-language-option svg {
  width: 17px;
  height: 17px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.home-language-option:last-child {
  border-radius: 0 8px 8px 0;
}

.home-language-option + .home-language-option {
  margin-left: -1px;
}

.home-language-option[aria-pressed="true"] {
  z-index: 1;
  border-color: var(--a-brand);
  background: var(--a-brand);
  color: #fff;
}

.home-language-option:focus-visible {
  z-index: 2;
  outline: 2px solid rgba(47, 93, 85, 0.32);
  outline-offset: 2px;
}

/* По центру, а не по верхнему краю: у логотипа margin -5px, и при
   выравнивании по верху он вставал на те же 5px выше кнопки «Поделиться». */
.home-brand {
  display: flex;
  min-width: 0;
  align-items: center;
  gap: 10px;
}

.home-brand > div {
  min-width: 0;
  padding-top: 1px;
}

.home-brand img {
  width: 62px;
  height: 62px;
  margin: -5px;
  object-fit: contain;
  filter: drop-shadow(3px 3px 0 rgba(18, 54, 61, 0.1));
}

.home-brand h1 {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  color: var(--brand);
  font-size: 27px;
  font-weight: 900;
  letter-spacing: 0.04em;
}

.home-content {
  display: grid;
  gap: 10px;
}

.home-card {
  width: 100%;
  min-height: 118px;
  padding: 14px;
  border: 1px solid rgba(18, 54, 61, 0.16);
  border-radius: 8px;
  background: var(--panel);
  color: var(--ink);
  text-align: left;
  box-shadow: 7px 7px 0 rgba(18, 54, 61, 0.1);
}

.home-card h2,
.home-card p {
  margin-bottom: 8px;
}

.home-card p {
  max-width: 30rem;
  color: var(--muted);
  font-size: 14px;
  font-weight: 600;
  line-height: 1.35;
}

.home-card-kicker {
  display: inline-flex;
  max-width: 100%;
  margin-bottom: 8px;
  padding: 4px 8px;
  border-radius: 6px;
  background: rgba(255, 255, 255, 0.88);
  color: var(--brand);
  font-size: 11px;
  font-weight: 900;
  text-transform: uppercase;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.home-card-meta {
  display: flex;
  flex-wrap: nowrap;
  gap: 8px;
  min-width: 0;
  max-width: 100%;
  overflow: hidden;
}

.home-card-meta span {
  display: inline-flex;
  flex: 0 1 auto;
  min-width: 0;
  max-width: 100%;
  min-height: 26px;
  align-items: center;
  padding: 4px 8px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.86);
  color: var(--ink);
  font-size: 12px;
  font-weight: 900;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.home-trainer-shell {
  position: relative;
  margin: 0 -6px 12px;
  padding: 10px;
  border: 1px solid rgba(18, 54, 61, 0.14);
  border-radius: 8px;
  background:
    linear-gradient(145deg, rgba(18, 54, 61, 0.12), rgba(255, 255, 255, 0.86) 54%, rgba(46, 196, 214, 0.12)),
    #e8f1ef;
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.82),
    7px 7px 0 rgba(18, 54, 61, 0.08);
}

.home-trainer-hide {
  position: absolute;
  z-index: 2;
  right: 22px;
  bottom: 22px;
  min-height: 30px;
  padding: 5px 10px;
  border: 1px solid rgba(18, 54, 61, 0.18);
  border-radius: 8px;
  background: var(--active-button-gradient);
  color: #fff;
  font-size: 12px;
  font-weight: 900;
  box-shadow: var(--active-button-shadow);
}

.trainer-card {
  cursor: pointer;
  display: grid;
  grid-template-rows: auto 1fr auto;
  gap: 12px;
  min-height: 181px;
  padding: 12px;
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.85),
    inset 0 -10px 18px rgba(18, 54, 61, 0.05);
  background:
    linear-gradient(145deg, rgba(18, 54, 61, 0.7), rgba(18, 54, 61, 0.18) 46%, rgba(255, 253, 248, 0.24)),
    linear-gradient(145deg, rgba(255, 255, 255, 0.22), rgba(198, 207, 203, 0.2)),
    url("./assets/kazan-cover.jpg"),
    var(--panel);
  background-position: center;
  background-size: cover;
  color: #fff;
}

.trainer-card:hover {
  transform: translateY(-1px);
}

.trainer-card:active {
  transform: translateY(1px);
}

.trainer-card h2 {
  width: fit-content;
  max-width: 100%;
  margin: 0 0 5px;
  padding: 4px 8px;
  border-radius: 6px;
  background: rgba(255, 255, 255, 0.88);
  color: var(--ink);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.trainer-card p {
  width: fit-content;
  max-width: 100%;
  margin: 0;
  padding: 5px 8px;
  border-radius: 6px;
  background: rgba(255, 255, 255, 0.82);
  color: var(--ink);
}

.trainer-card .home-card-kicker {
  color: var(--brand);
}

.trainer-card .trip-card-title-block {
  width: 100%;
}

.create-trip-card {
  display: grid;
  grid-template-columns: 46px minmax(0, 1fr);
  align-items: center;
  gap: 10px;
  min-height: 68px;
  margin-top: 0;
  padding: 10px;
  background:
    var(--app-gradient),
    var(--panel);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.85),
    inset 0 -8px 16px rgba(18, 54, 61, 0.05),
    7px 7px 0 rgba(18, 54, 61, 0.1),
    0 14px 28px rgba(18, 54, 61, 0.1);
}

.create-trip-card strong,
.ideas-entry-card strong,
.create-trip-card small {
  display: block;
}

.create-trip-card strong,
.ideas-entry-card strong {
  font-size: 17px;
  font-weight: 900;
  line-height: 1.12;
}

.create-trip-card small,
.ideas-entry-card small {
  margin-top: 3px;
  color: var(--ink);
  font-size: 12px;
  font-weight: 400;
  line-height: normal;
}

.ideas-entry-card {
  display: grid;
  grid-template-columns: 46px minmax(0, 1fr);
  align-items: center;
  gap: 10px;
  min-height: 68px;
  padding: 10px;
  background:
    var(--app-gradient),
    var(--panel);
  text-align: left;
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.85),
    inset 0 -8px 16px rgba(18, 54, 61, 0.05),
    7px 7px 0 rgba(18, 54, 61, 0.1),
    0 14px 28px rgba(18, 54, 61, 0.1);
}

.ideas-entry-card small {
  display: block;
}

.cover-icon,
.ideas-entry-icon {
  display: grid;
  width: 46px;
  height: 46px;
  place-items: center;
  border-radius: 8px;
  background: var(--active-button-gradient);
  box-shadow: var(--active-button-shadow);
}

.ideas-entry-icon {
  width: 46px;
  height: 46px;
}

.cover-icon svg,
.ideas-entry-icon svg {
  width: 28px;
  height: 28px;
  fill: none;
  stroke: #fff;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.trip-list-section {
  display: grid;
  gap: 4px;
  margin-top: 12px;
}

.home-list-heading {
  margin-bottom: 0;
}

.home-list-heading h2 {
  font-size: 18px;
}

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

.ios-install-card {
  position: relative;
  display: grid;
  gap: 8px;
  margin-top: 12px;
  padding: 14px 44px 14px 14px;
  border: 1px solid rgba(18, 54, 61, 0.2);
  border-radius: 8px;
  background:
    linear-gradient(135deg, rgba(255, 255, 255, 0.9), rgba(227, 235, 232, 0.86)),
    var(--panel);
  box-shadow: 0 12px 28px rgba(18, 54, 61, 0.12);
}

.ios-install-card h2 {
  margin: 0;
  color: var(--ink);
  font-size: 18px;
  font-weight: 900;
  line-height: 1.1;
}

.ios-install-card p,
.ios-install-card li {
  color: var(--ink);
  font-size: 13px;
  font-weight: 650;
  line-height: 1.35;
}

.ios-install-card p,
.ios-install-card ol {
  margin: 0;
}

.ios-install-card ol {
  display: grid;
  gap: 4px;
  padding-left: 18px;
}

.ios-install-close {
  position: absolute;
  top: 8px;
  right: 8px;
  display: grid;
  width: 31px;
  height: 31px;
  place-items: center;
  border: 1px solid rgba(18, 54, 61, 0.18);
  border-radius: 6px;
  background: rgba(255, 255, 255, 0.72);
  color: var(--ink);
  font-size: 22px;
  font-weight: 850;
  line-height: 1;
}

/* The only way back after hiding the trainer, so it stays where the trainer was. */
.home-trainer-restore {
  justify-self: start;
  padding: 6px 0;
  border: 0;
  background: none;
  color: var(--ink);
  font-size: 13px;
  font-weight: 700;
  line-height: 1.2;
  text-decoration: underline;
  text-underline-offset: 3px;
  opacity: 0.7;
}

.trip-draft-resume {
  display: grid;
  gap: 10px;
}

/* An unpriced card must not read as a free one, and an estimate must not read as a fact. */
.trip-draft-price-note,
.trip-draft-budget-note {
  margin: 0;
  color: var(--muted);
  font-size: 12px;
  font-weight: 650;
  line-height: 1.35;
}

.trip-draft-price-note.is-estimate,
.trip-draft-price-note.is-extracted {
  color: #8a5a12;
}

.trip-draft-price-note.is-mismatch {
  color: #8b2f28;
}

.trip-draft-documents {
  display: grid;
  gap: 10px;
}

.trip-draft-documents-list {
  display: grid;
  gap: 6px;
}

.trip-draft-document-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 10px;
  padding: 8px 10px;
  border: 1px solid rgba(18, 54, 61, 0.12);
  border-radius: 10px;
  background: #fff;
}

.trip-draft-document-row.is-missing {
  border-color: rgba(139, 47, 40, 0.35);
}

.trip-draft-document-name {
  display: block;
  overflow: hidden;
  color: var(--ink);
  font-size: 13px;
  font-weight: 700;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.trip-draft-document-meta,
.trip-draft-document-empty,
.trip-draft-documents-missing {
  margin: 0;
  color: var(--muted);
  font-size: 12px;
  font-weight: 650;
  line-height: 1.35;
}

.trip-draft-documents-missing {
  color: #8b2f28;
}

.booking-pack-upload-notice {
  display: grid;
  gap: 8px;
  border-color: rgba(139, 47, 40, 0.35);
}

.booking-pack-upload-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.sync-conflict-card {
  position: relative;
  display: grid;
  gap: 8px;
  margin-bottom: 12px;
  padding: 14px 44px 14px 14px;
  border: 1px solid rgba(196, 122, 32, 0.45);
  border-left: 4px solid rgba(196, 122, 32, 0.75);
  border-radius: 8px;
  background:
    linear-gradient(135deg, rgba(255, 252, 245, 0.95), rgba(250, 240, 224, 0.9)),
    var(--panel);
  box-shadow: 0 12px 28px rgba(18, 54, 61, 0.12);
}

.sync-conflict-card h2 {
  margin: 0;
  color: var(--ink);
  font-size: 18px;
  font-weight: 900;
  line-height: 1.1;
}

.sync-conflict-card p {
  margin: 0;
  color: var(--ink);
  font-size: 13px;
  font-weight: 650;
  line-height: 1.35;
}

.sync-conflict-hint {
  opacity: 0.78;
}

.sync-conflict-list {
  display: grid;
  gap: 4px;
  margin: 0;
  padding-left: 18px;
  color: var(--ink);
  font-size: 13px;
  font-weight: 800;
  line-height: 1.35;
}

.sync-conflict-close {
  position: absolute;
  top: 8px;
  right: 8px;
  display: grid;
  width: 31px;
  height: 31px;
  place-items: center;
  border: 1px solid rgba(18, 54, 61, 0.18);
  border-radius: 6px;
  background: rgba(255, 255, 255, 0.72);
  color: var(--ink);
  font-size: 22px;
  font-weight: 850;
  line-height: 1;
}

.home-support {
  display: grid;
  gap: 4px;
  margin-top: 12px;
}

.home-support-menu {
  position: fixed;
  right: max(14px, calc((100vw - 760px) / 2 + 14px));
  bottom: 12px;
  left: max(14px, calc((100vw - 760px) / 2 + 14px));
  z-index: 30;
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 8px;
  padding: 6px 8px;
  border: 1px solid rgba(18, 54, 61, 0.12);
  border-radius: 8px;
  background:
    var(--app-gradient),
    var(--panel);
  box-shadow:
    0 -10px 24px rgba(18, 54, 61, 0.16),
    inset 0 1px 0 rgba(255, 255, 255, 0.86),
    inset 0 -10px 18px rgba(18, 54, 61, 0.05);
}

.home-support-button {
  display: grid;
  min-height: 45px;
  place-items: center;
  align-content: center;
  padding: 6px;
  border: 1px solid rgba(18, 54, 61, 0.22);
  border-radius: 8px;
  background: var(--active-button-gradient);
  color: #fff;
  text-align: center;
  text-decoration: none;
  box-shadow: var(--active-button-shadow);
}

.home-support-button span,
.home-support-button svg,
.home-support-icon {
  display: grid;
  width: 30px;
  height: 30px;
  place-items: center;
  object-fit: contain;
  color: #fff;
  fill: none;
  stroke: #fff;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
  font-size: 22px;
  font-weight: 900;
}

.home-support-icon {
  filter: invert(1) brightness(2);
}

button:disabled,
button[aria-disabled="true"] {
  cursor: not-allowed;
  border-color: rgba(18, 54, 61, 0.22);
  background:
    var(--app-gradient),
    var(--panel);
  color: var(--muted);
  opacity: 1;
  filter: none;
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.85),
    inset 0 -8px 16px rgba(18, 54, 61, 0.05),
    4px 4px 0 rgba(18, 54, 61, 0.08);
}

button:disabled span,
button[aria-disabled="true"] span {
  color: #fff;
}

button:disabled svg,
button[aria-disabled="true"] svg {
  color: #fff;
  stroke: #fff;
}

button:disabled .home-support-icon,
button[aria-disabled="true"] .home-support-icon {
  filter: invert(1) brightness(2);
}

.home-support-panel,
.home-support-sheet-body {
  display: grid;
  gap: 10px;
  padding: 14px;
  border: 1px dashed rgba(18, 54, 61, 0.22);
  border-radius: 8px;
  background: #fff;
  color: var(--muted);
}

.home-support-sheet {
  padding-bottom: calc(18px + env(safe-area-inset-bottom));
}

.donation-sheet-panel {
  display: grid;
  gap: 12px;
  padding-bottom: calc(14px + env(safe-area-inset-bottom));
  touch-action: pan-y;
  transition: transform 0.18s ease;
}

.donation-sheet-handle {
  justify-self: center;
  width: 42px;
  height: 4px;
  border-radius: 999px;
  background: rgba(18, 54, 61, 0.22);
}

.donation-sheet-copy {
  margin: 0;
  color: var(--ink);
  font-size: 15px;
  font-weight: 400;
  line-height: 1.42;
  white-space: pre-line;
}

.donation-sheet-actions {
  display: grid;
  gap: 10px;
}

.donation-sheet-actions .primary-button,
.donation-sheet-actions .ghost-button {
  display: grid;
  min-height: 45px;
  place-items: center;
  line-height: 1;
}

#donationCtaButton {
  border-color: rgba(18, 54, 61, 0.34);
  background: var(--active-button-gradient);
  color: #fff;
  box-shadow: var(--active-button-shadow);
}

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

.donation-amount-step.hidden {
  display: none;
}

.donation-amount-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.donation-amount-grid.hidden {
  display: none;
}

.donation-amount-button {
  display: grid;
  min-height: 45px;
  place-items: center;
  border: 1px solid rgba(18, 54, 61, 0.34);
  border-radius: 6px;
  background: var(--active-button-gradient);
  color: #fff;
  font-weight: 800;
  line-height: 1;
  box-shadow: var(--active-button-shadow);
}

.donation-back-button {
  display: grid;
  min-height: 42px;
  place-items: center;
}

.donation-custom-amount {
  display: grid;
  gap: 10px;
}

.donation-custom-amount.hidden {
  display: none;
}

.donation-custom-amount .primary-button {
  display: grid;
  min-height: 45px;
  place-items: center;
  border-color: rgba(18, 54, 61, 0.34);
  background: var(--active-button-gradient);
  color: #fff;
  box-shadow: var(--active-button-shadow);
}

.home-support-panel h2 {
  color: var(--ink);
  font-size: 20px;
}

.home-support-panel p,
.home-support-sheet-body p {
  margin: 0;
  color: var(--ink);
  font-size: 14px;
  font-weight: 500;
  line-height: 1.42;
}

.home-support-panel details,
.home-support-sheet-body details {
  padding: 10px 0;
  border-top: 1px solid rgba(18, 54, 61, 0.12);
}

.home-support-panel details:first-of-type,
.home-support-sheet-body details:first-of-type {
  border-top: 0;
}

.home-support-panel summary,
.home-support-sheet-body summary {
  cursor: pointer;
  color: var(--brand);
  font-size: 15px;
  font-weight: 900;
}

.home-trainer-toggle {
  width: 100%;
  margin-top: 6px;
  min-height: 45px;
  border: 1px solid rgba(18, 54, 61, 0.22);
  border-radius: 8px;
  background: var(--active-button-gradient);
  color: #fff;
  font-size: 15px;
  font-weight: 900;
  box-shadow: var(--active-button-shadow);
}

.home-support-external-link {
  display: inline-flex;
  width: fit-content;
  min-height: 40px;
  margin-top: 8px;
  align-items: center;
  justify-content: center;
  text-decoration: none;
}

.trip-list-card {
  position: relative;
  display: grid;
  gap: 12px;
  min-height: 112px;
  padding: 0;
  overflow: hidden;
  background:
    var(--app-gradient),
    var(--panel);
  background-position: center;
  background-size: cover;
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.85),
    inset 0 -8px 16px rgba(18, 54, 61, 0.05),
    7px 7px 0 rgba(18, 54, 61, 0.1),
    0 14px 28px rgba(18, 54, 61, 0.1);
}

.trip-card-open {
  position: relative;
  display: grid;
  grid-template-rows: auto 1fr auto;
  gap: 12px;
  width: 100%;
  height: 100%;
  min-height: 112px;
  padding: 12px;
  border: 0;
  background: transparent;
  color: inherit;
  text-align: left;
}

.trip-card-status-row {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  max-width: calc(100% - 58px);
}

.trip-card-title-block {
  display: grid;
  align-content: start;
  justify-items: start;
  gap: 6px;
  min-width: 0;
}

.trip-list-card strong,
.trip-card-title-block > span {
  display: block;
}

.trip-list-card strong {
  width: fit-content;
  max-width: 100%;
  margin-bottom: 5px;
  padding: 4px 8px;
  border-radius: 6px;
  background: rgba(255, 255, 255, 0.88);
  color: var(--ink);
  font-size: 22px;
  line-height: 1.12;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.trip-card-title-block > span {
  width: fit-content;
  max-width: 100%;
  margin-bottom: 8px;
  padding: 3px 8px;
  border-radius: 6px;
  background: rgba(255, 255, 255, 0.82);
  color: var(--ink);
  font-size: 13px;
  font-weight: 400;
}

/* The cover button floats over the top-right corner, so only the title row, which sits
   level with it, makes room. The destination row is below it and uses the full width. */
.trip-list-card:not(.received-trip-card) strong {
  max-width: calc(100% - 60px);
}

.trip-card-submeta {
  display: flex;
  flex-wrap: nowrap;
  gap: 6px;
  justify-self: stretch;
  width: 100%;
  min-width: 0;
  max-width: 100%;
  overflow: hidden;
}

/* The destination takes every spare pixel, pushing the dates to the right edge,
   and truncates once it runs out of room. The dates never shrink. */
.trip-card-submeta > span {
  display: inline-flex;
  flex: 1 1 auto;
  min-width: 0;
  max-width: 100%;
  min-height: 28px;
  align-items: center;
  padding: 3px 8px;
  border-radius: 6px;
  background: rgba(255, 255, 255, 0.82);
  color: var(--ink);
  font-size: 13px;
  font-weight: 400;
  line-height: 1.2;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* Dates size to their content and are the last thing to give way. max-width keeps an
   extreme range from spilling out of the card instead of letting it overflow unclipped. */
.trip-card-submeta > span:last-child {
  flex: 0 0 auto;
}

.trip-card-open .home-card-meta {
  min-width: 0;
  padding-right: 86px;
}

.received-trips-section {
  margin-top: 12px;
}

.received-trip-card .trip-card-status-row {
  max-width: 100%;
}

.received-trip-card .trip-card-open .home-card-meta {
  padding-right: 112px;
}

.received-trip-card .home-card-kicker {
  background: rgba(18, 54, 61, 0.88);
  color: #fff;
}

.received-trip-author-badge {
  max-width: min(52%, 180px);
  overflow: hidden;
  text-overflow: ellipsis;
  text-transform: none;
  white-space: nowrap;
}

.received-trip-card-closed {
  opacity: 0.78;
}

.received-trip-card-closed .trip-card-open {
  cursor: default;
}

.received-trip-card-closed strong,
.received-trip-card-closed .trip-card-open > span:not(.home-card-kicker) {
  background: rgba(255, 255, 255, 0.72);
}

.received-trip-remove-button {
  max-width: calc(100% - 24px);
}

.proposal-inbox-card {
  display: grid;
  gap: 10px;
}

.proposal-inbox-list,
.proposal-choice,
.proposal-summary {
  display: grid;
  gap: 10px;
}

.proposal-card {
  display: grid;
  gap: 10px;
  padding: 10px;
  border: 1px solid rgba(18, 54, 61, 0.14);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.78);
}

.proposal-card p,
.proposal-summary p {
  margin-bottom: 0;
  color: var(--muted);
  font-size: 14px;
  font-weight: 600;
  line-height: 1.35;
}

.proposal-card span {
  color: var(--brand);
  font-size: 12px;
  font-weight: 900;
}

.proposal-card strong,
.proposal-card p {
  min-width: 0;
  overflow-wrap: anywhere;
}

.proposal-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.expense-proposal-body {
  display: grid;
  gap: 14px;
}

.expense-proposal-body .primary-button,
.expense-proposal-body .ghost-button {
  width: 100%;
}

.save-received-button {
  display: inline-grid;
  min-height: 38px;
  width: fit-content;
  max-width: 100%;
  place-items: center;
  margin: 8px 0 0;
  padding: 0 12px;
  border: 1px solid rgba(18, 54, 61, 0.22);
  border-radius: 8px;
  background: var(--active-button-gradient);
  color: #fff;
  box-shadow: var(--active-button-shadow);
  font-size: 13px;
  font-weight: 900;
  line-height: 1.1;
}

.cover-trip-button,
.delete-trip-button {
  position: absolute;
  display: inline-grid;
  place-items: center;
  border: 0;
  border-radius: 8px;
  background: var(--active-button-gradient);
  color: #fff;
  box-shadow: var(--active-button-shadow);
}

.cover-trip-button {
  top: 12px;
  right: 12px;
  width: 46px;
  height: 46px;
  padding: 0;
}

.cover-trip-button svg {
  width: 28px;
  height: 28px;
  fill: none;
  stroke: #fff;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.delete-trip-button {
  right: 12px;
  bottom: 12px;
  min-height: 28px;
  padding: 5px 10px;
  font-size: 12px;
  font-weight: 700;
}

.empty-trips {
  display: grid;
  gap: 4px;
  margin: 0;
  padding: 14px;
  border: 1px dashed rgba(18, 54, 61, 0.22);
  border-radius: 8px;
  color: var(--muted);
  font-size: 14px;
  font-weight: 700;
  line-height: 1.35;
}

.empty-trips span {
  display: block;
}

.home-profile-card {
  display: block;
  width: min(100%, 220px);
  min-width: 0;
  min-height: 27px;
  margin-top: 4px;
  padding: 5px 9px;
  border: 1px solid rgba(18, 54, 61, 0.16);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.62);
  color: var(--ink);
  text-align: left;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.72);
}

.home-profile-card.hidden {
  display: none;
}

.home-profile-card strong {
  display: block;
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 13px;
  line-height: 1.2;
}

.ideas-screen {
  width: min(100%, 760px);
  min-height: 100vh;
  margin: 0 auto;
  padding: 0 14px 96px;
  background: #fff;
}

.ideas-header {
  position: sticky;
  top: 0;
  z-index: 12;
  display: grid;
  grid-template-columns: 46px minmax(0, 1fr);
  align-items: center;
  gap: 10px;
  margin: 0 -14px 12px;
  padding: 14px 14px 15px;
  border-bottom: 1px solid rgba(222, 216, 204, 0.8);
  background:
    var(--app-gradient),
    var(--panel);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.85),
    0 6px 0 rgba(18, 54, 61, 0.08),
    0 16px 28px rgba(18, 54, 61, 0.1);
}

.ideas-header h1 {
  margin: 0;
  overflow: hidden;
  color: var(--ink);
  font-size: 24px;
  font-weight: 900;
  line-height: 1.05;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.ideas-header p {
  margin: 3px 0 0;
  overflow: hidden;
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
  line-height: 1.2;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.ideas-back-button {
  border-color: rgba(18, 54, 61, 0.34);
  background: var(--active-button-gradient);
  color: #fff;
  box-shadow: var(--active-button-shadow);
}

.ideas-content {
  display: grid;
  gap: 12px;
}

.ideas-collection-row {
  display: flex;
  gap: 8px;
  margin: 0 -14px;
  padding: 2px 14px 10px;
  overflow-x: auto;
  scrollbar-width: none;
  scroll-padding-inline: 14px;
}

.ideas-collection-row::-webkit-scrollbar {
  display: none;
}

.idea-collection-chip {
  flex: 0 0 auto;
  max-width: min(76vw, 260px);
  min-height: 36px;
  padding: 0 13px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.84);
  color: var(--ink);
  font-size: 13px;
  font-weight: 850;
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.8),
    3px 3px 0 rgba(18, 54, 61, 0.05);
}

.idea-collection-chip span {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.idea-collection-chip[aria-pressed="true"] {
  border-color: rgba(18, 54, 61, 0.34);
  background: var(--active-button-gradient);
  color: #fff;
  box-shadow: var(--active-button-shadow);
}

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

.ideas-fab {
  position: fixed;
  right: max(16px, calc((100vw - 760px) / 2 + 16px));
  bottom: 18px;
  z-index: 14;
  display: grid;
  width: 62px;
  height: 62px;
  place-items: center;
  border: 1px solid rgba(18, 54, 61, 0.34);
  border-radius: 14px;
  background: var(--active-button-gradient);
  color: #fff;
  box-shadow: var(--active-button-shadow);
  font-size: 42px;
  font-weight: 500;
  line-height: 1;
}

.ideas-fab:active {
  transform: translateY(1px);
}

.ideas-state-card {
  display: grid;
  gap: 8px;
  padding: 16px;
  border: 1px dashed rgba(18, 54, 61, 0.22);
  border-radius: 12px;
  background:
    linear-gradient(135deg, rgba(255, 255, 255, 0.92), rgba(242, 247, 245, 0.72)),
    var(--panel);
  color: var(--muted);
  box-shadow: 5px 5px 0 rgba(18, 54, 61, 0.07);
}

.ideas-state-card strong {
  color: var(--ink);
  font-size: 18px;
  font-weight: 900;
}

.ideas-state-card p {
  margin: 0;
  font-size: 13px;
  font-weight: 700;
  line-height: 1.35;
}

.ideas-state-card.is-error {
  border-color: rgba(158, 61, 54, 0.28);
  color: var(--danger);
  background: var(--danger-soft);
}

.ideas-extension-promo {
  white-space: normal;
}

.ideas-extension-promo p {
  white-space: pre-line;
}

.ideas-extension-promo .ideas-extension-device {
  color: var(--ink);
  font-weight: 900;
}

.ideas-extension-promo .ideas-extension-cta {
  display: inline-flex;
  width: fit-content;
  min-height: 40px;
  align-items: center;
  justify-content: center;
  padding: 0 14px;
  border-color: rgba(18, 54, 61, 0.34);
  background: var(--active-button-gradient);
  color: #fff;
  box-shadow: var(--active-button-shadow);
  font-size: 16px;
  font-weight: 700;
  text-decoration: none;
}

.ideas-state-actions {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
  margin-top: 2px;
}

.ideas-state-actions .ghost-button,
.ideas-state-actions .primary-button {
  width: 100%;
  min-width: 0;
  border-color: rgba(18, 54, 61, 0.34);
  background: var(--active-button-gradient);
  color: #fff;
  box-shadow: var(--active-button-shadow);
}

.idea-card {
  display: grid;
  grid-template-columns: 68px minmax(0, 1fr);
  gap: 11px;
  width: 100%;
  min-height: 92px;
  padding: 10px;
  border: 1px solid rgba(18, 54, 61, 0.14);
  border-radius: 12px;
  background:
    linear-gradient(135deg, rgba(255, 255, 255, 0.96), rgba(244, 241, 232, 0.76)),
    var(--panel);
  color: var(--ink);
  text-align: left;
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.88),
    5px 5px 0 rgba(18, 54, 61, 0.08),
    0 12px 24px rgba(18, 54, 61, 0.08);
}

.idea-card-thumb {
  position: relative;
  display: grid;
  width: 68px;
  min-height: 68px;
  place-items: center;
  overflow: hidden;
  border-radius: 10px;
  background:
    var(--active-button-gradient),
    var(--brand);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.2);
}

.idea-card-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.idea-card-thumb.has-image:not(.image-broken) .idea-card-thumb-fallback {
  display: none;
}

.idea-card-thumb.image-broken img {
  display: none;
}

.idea-card-thumb-fallback {
  display: grid;
  width: 36px;
  height: 36px;
  place-items: center;
  color: #fff;
}

.idea-card-thumb-fallback svg {
  width: 30px;
  height: 30px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.idea-card-body {
  display: grid;
  min-width: 0;
  align-content: start;
  gap: 5px;
}

.idea-card-title {
  overflow: hidden;
  color: var(--ink);
  font-size: 16px;
  font-weight: 900;
  line-height: 1.15;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.idea-card-meta,
.idea-card-extra,
.idea-card-copy {
  margin: 0;
  overflow: hidden;
  color: var(--muted);
  font-size: 12px;
  font-weight: 750;
  line-height: 1.3;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.idea-card-copy {
  display: -webkit-box;
  overflow: hidden;
  white-space: normal;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
}

.app-shell {
  width: min(100%, 1160px);
  min-height: 100vh;
  margin: 0 auto;
  padding-bottom: 86px;
  background: #fff;
}

.trip-header {
  position: sticky;
  top: 0;
  z-index: 10;
  padding: 14px 14px 12px;
  background:
    var(--app-gradient),
    var(--panel);
  border-bottom: 1px solid rgba(222, 216, 204, 0.8);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.85),
    inset 0 -10px 18px rgba(18, 54, 61, 0.05),
    0 6px 0 rgba(18, 54, 61, 0.1),
    0 18px 34px rgba(18, 54, 61, 0.12);
  backdrop-filter: blur(12px);
}

.profile-sheet-panel {
  max-height: min(72vh, 520px);
}

.profile-form {
  gap: 13px;
}

.profile-copy {
  grid-column: 1 / -1;
  margin: 0;
  color: var(--muted);
  font-size: 14px;
  font-weight: 700;
  line-height: 1.4;
}

.profile-form > .field-hint {
  grid-column: 1 / -1;
  width: 100%;
}

.profile-error {
  min-height: 18px;
  margin: -4px 0 0;
  color: var(--danger);
  font-size: 13px;
  font-weight: 800;
}

.recoverable-auth-card {
  margin-top: 14px;
  padding: 14px;
  border: 1px solid rgba(18, 54, 61, 0.14);
  border-radius: 14px;
  background:
    linear-gradient(135deg, rgba(255, 255, 255, 0.82), rgba(242, 247, 245, 0.7)),
    var(--paper);
  box-shadow: 0 5px 0 rgba(18, 54, 61, 0.09);
}

.recoverable-auth-card[hidden],
.recoverable-auth-form[hidden] {
  display: none;
}

.recoverable-auth-heading h3 {
  margin: 0 0 4px;
  color: var(--ink);
  font-size: 18px;
  line-height: 1.15;
}

.recoverable-auth-heading p,
.recoverable-auth-status {
  margin: 0;
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
  line-height: 1.35;
}

.recoverable-auth-status {
  min-height: 18px;
  margin-top: 8px;
  color: var(--accent-strong);
}

.recoverable-auth-status.error {
  color: var(--danger);
}

.recoverable-auth-form {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 10px;
  width: 100%;
  margin-top: 12px;
}

.recoverable-auth-form .field,
.recoverable-auth-form .field-hint,
.recoverable-auth-form input,
.recoverable-auth-form button {
  width: 100%;
  min-width: 0;
}

.recoverable-auth-form .field,
.recoverable-auth-form .field.wide {
  grid-column: 1 / -1;
}

.profile-sheet-panel #profileSaveButton,
.recoverable-auth-form .primary-button,
.recoverable-auth-form .ghost-button {
  min-height: 44px;
  border-color: rgba(18, 54, 61, 0.34);
  background: var(--active-button-gradient);
  color: #fff;
  box-shadow: var(--active-button-shadow);
}

.recoverable-auth-login-form {
  padding-top: 12px;
  border-top: 1px solid rgba(18, 54, 61, 0.12);
}

.proposal-account-link {
  margin-top: 4px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

.brand-row,
.section-heading,
.card-title-row,
.sheet-header,
.form-actions,
.item-top,
.item-meta,
.budget-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.brand-lockup {
  display: flex;
  min-width: 0;
  align-items: center;
  gap: 10px;
}

/* Первая колонка держит место под абсолютную кнопку возврата: 46px самой
   кнопки плюс воздух до заголовка. Раньше здесь стояло лого шириной 62px. */
.brand-row {
  display: grid;
  position: relative;
  grid-template-columns: 40px minmax(0, 1fr) auto;
  min-height: 46px;
  gap: 16px;
}

.brand-lockup {
  display: contents;
}

/* Возврат на главную выглядит как остальные кнопки шапки: тот же размер,
   заливка и тень, что у «Настройки» и «Поделиться». Раньше здесь стояло
   лого, и кнопка не читалась как кнопка. */
.brand-home-button {
  display: grid;
  position: absolute;
  top: 0;
  bottom: 0;
  left: 0;
  width: 40px;
  height: 40px;
  /* Центрируется полями, а не transform: transform занят состоянием :active. */
  margin: auto 0;
  place-items: center;
  padding: 0;
  border: 1px solid rgba(18, 54, 61, 0.34);
  border-radius: 8px;
  background: var(--active-button-gradient);
  color: #fff;
  box-shadow: var(--active-button-shadow);
  cursor: pointer;
}

/* Обе кнопки возврата — в шапке поездки и в «Идеях» — рисуют одну стрелку
   одной толщиной, иначе экраны расходятся между собой. */
.brand-home-button svg,
.ideas-back-button svg {
  width: 24px;
  height: 24px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2.6;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.brand-home-button:hover {
  border-color: rgba(18, 54, 61, 0.5);
  box-shadow:
    var(--active-button-shadow),
    0 0 0 3px rgba(130, 207, 191, 0.28);
}

.brand-home-button:active {
  transform: translateY(1px);
}

.brand-home-button:focus-visible {
  outline: 3px solid rgba(22, 123, 104, 0.72);
  outline-offset: 3px;
}

.brand-lockup > div {
  grid-column: 2;
  width: 100%;
  min-width: 0;
  max-width: min(100%, 360px);
  justify-self: start;
  text-align: left;
}

.brand-row > .header-actions {
  grid-column: 3;
}

.brand-logo {
  display: block;
  position: relative;
  z-index: 1;
  width: 62px;
  height: 62px;
  justify-self: center;
  align-self: center;
  object-fit: contain;
  filter: drop-shadow(3px 3px 0 rgba(18, 54, 61, 0.1));
}

#tripTitle {
  display: -webkit-box;
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
}

h1,
h2,
h3,
p {
  margin-top: 0;
}

h1 {
  margin-bottom: 0;
  font-size: 22px;
  line-height: 1.08;
}

h2 {
  margin-bottom: 0;
  font-size: 20px;
  line-height: 1.15;
}

h3 {
  margin-bottom: 0;
  font-size: 16px;
}

.day-header h3,
.unscheduled-card > .card-title-row h3 {
  font-size: 21px;
  line-height: 1.08;
}

.trip-meta {
  width: 100%;
  margin: 10px 0 6px;
  padding: 0;
  border: 0;
  background: transparent;
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
  text-align: left;
  line-height: 1.35;
}

.trip-meta::after {
  content: "";
}

.trip-budget-meta {
  display: flex;
  align-items: center;
  justify-content: flex-start;
  min-height: 28px;
  width: 100%;
  max-width: none;
  margin: 0;
  padding: 5px 10px;
  border: 1px solid rgba(18, 54, 61, 0.18);
  border-radius: 6px;
  background: rgba(255, 253, 248, 0.74);
  color: var(--brand);
  box-shadow:
    inset 1px 1px 0 rgba(255, 255, 255, 0.64),
    3px 3px 0 rgba(18, 54, 61, 0.08);
  font-size: 13px;
  font-weight: 800;
  text-align: left;
  line-height: 1.15;
}

.trip-summary-row {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
  margin: 4px 0 8px;
}

.trip-budget-meta {
  grid-column: 2 / -1;
}

.share-role-banner {
  min-width: 0;
  min-height: 28px;
  margin: 0;
  padding: 6px 10px;
  overflow: hidden;
  border: 1px solid rgba(18, 54, 61, 0.14);
  border-radius: 6px;
  background: rgba(255, 255, 255, 0.58);
  color: var(--ink);
  font-size: 13px;
  font-weight: 800;
  line-height: 1.15;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.share-role-banner.hidden {
  visibility: hidden;
}

.header-actions {
  display: flex;
  justify-self: end;
  flex-shrink: 0;
  gap: 8px;
}

.budget-strip {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
}

.budget-strip div,
.metric-card {
  min-height: 58px;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--panel);
  box-shadow: 6px 6px 0 rgba(18, 54, 61, 0.12);
}

.budget-strip .paid-card {
  border-color: rgba(45, 123, 82, 0.3);
  background: #eff8f1;
  box-shadow: 6px 6px 0 rgba(45, 123, 82, 0.14);
}

.budget-strip span,
.metric-card span,
.muted {
  display: block;
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
  line-height: 1.15;
}

.budget-strip span {
  min-height: 28px;
}

.budget-strip .paid-card span {
  color: #2d7b52;
}

.budget-strip .paid-card span::before {
  content: "✓";
  display: inline-grid;
  place-items: center;
  width: 15px;
  height: 15px;
  margin-right: 5px;
  border-radius: 999px;
  color: #fff;
  background: #2d7b52;
  font-size: 10px;
  line-height: 1;
  vertical-align: 1px;
}

.budget-strip strong,
.metric-card strong {
  display: block;
  margin-top: 4px;
  font-size: 15px;
  line-height: 1.1;
}

.main-content {
  padding: 14px;
}

.view {
  display: none;
}

.view.active {
  display: block;
}

.section-heading {
  margin-bottom: 12px;
}

.days-list,
.basket-list,
.budget-page {
  display: grid;
  gap: 12px;
}

.estimate-card {
  margin-top: 12px;
  padding: 12px;
}

.card,
.day-card,
.item-card {
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--panel);
  box-shadow: 6px 6px 0 rgba(18, 54, 61, 0.09);
}

.day-card {
  overflow: hidden;
}

.day-header {
  padding: 8px 12px;
  border-bottom: 1px solid var(--line);
  background:
    var(--app-gradient),
    var(--panel);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.78),
    inset 0 -8px 14px rgba(18, 54, 61, 0.04);
}

.day-header .card-title-row {
  min-height: 28px;
  align-items: center;
  gap: 8px;
}

.day-header p {
  display: none;
  margin: 0;
}

.day-date {
  min-width: 0;
  margin-right: auto;
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
  line-height: 1.15;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.day-total {
  color: var(--brand);
  font-size: 28px;
  font-weight: 700;
  line-height: 1;
  white-space: nowrap;
}

#unscheduledCount {
  color: var(--brand);
  font-size: 18px;
  font-weight: 700;
  line-height: 1;
  white-space: nowrap;
}

.day-items {
  display: flex;
  gap: 8px;
  padding: 14px 16px 12px;
  overflow-x: auto;
  touch-action: pan-x pan-y;
  overscroll-behavior-x: contain;
  scroll-snap-type: x mandatory;
  scroll-padding-inline: 16px;
  scrollbar-width: auto;
  scrollbar-color: #6f7877 rgba(18, 54, 61, 0.08);
}

.day-items::-webkit-scrollbar,
.basket-grid-list::-webkit-scrollbar,
.filter-row::-webkit-scrollbar {
  height: 12px;
}

.day-items::-webkit-scrollbar-track,
.basket-grid-list::-webkit-scrollbar-track,
.filter-row::-webkit-scrollbar-track {
  border-radius: 999px;
  background: rgba(18, 54, 61, 0.08);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.55);
}

.day-items::-webkit-scrollbar-thumb,
.basket-grid-list::-webkit-scrollbar-thumb,
.filter-row::-webkit-scrollbar-thumb {
  border: 2px solid rgba(244, 241, 235, 0.9);
  border-radius: 999px;
  background:
    linear-gradient(145deg, #e7ebe8 0%, #7e8987 44%, #cbd2ce 72%, #5f6968 100%);
}

.empty-state {
  margin: 0;
  padding: 14px;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.45;
}

.item-card {
  --item-card-bg: #ffefcf;
  --item-card-accent: #d88d22;
  --item-slot-bg: rgba(240, 165, 55, 0.62);
  --item-card-scale: 0.82;
  zoom: var(--item-card-scale);
  width: 220px;
  min-width: 220px;
  max-width: 220px;
  height: 264px;
  min-height: 264px;
  max-height: 264px;
  padding: 0;
  text-align: left;
  display: grid;
  grid-template-rows: 44px 220px;
  gap: 0;
  align-items: stretch;
  overflow: hidden;
  background: var(--item-card-bg);
  cursor: grab;
  touch-action: manipulation;
  user-select: none;
  -webkit-user-select: none;
  -webkit-touch-callout: none;
}

.mobile-dragging,
.mobile-dragging * {
  cursor: grabbing;
  touch-action: none;
  user-select: none;
  -webkit-user-select: none;
  -webkit-touch-callout: none;
}

.type-ticket {
  --item-card-bg: #ddf4e9;
  --item-card-accent: #4fb986;
  --item-slot-bg: rgba(101, 199, 160, 0.62);
}

.type-stay {
  --item-card-bg: #fff0c9;
  --item-card-accent: #e8a51d;
  --item-slot-bg: rgba(255, 190, 53, 0.62);
}

.type-transport {
  --item-card-bg: #d7f4f7;
  --item-card-accent: #1aaec3;
  --item-slot-bg: rgba(46, 196, 214, 0.62);
}

.type-excursion {
  --item-card-bg: #ffe1c8;
  --item-card-accent: #e97725;
  --item-slot-bg: rgba(255, 143, 61, 0.62);
}

.type-food {
  --item-card-bg: #ffe0db;
  --item-card-accent: #d94a35;
  --item-slot-bg: rgba(243, 95, 71, 0.62);
}

.type-place {
  --item-card-bg: #d9f1f5;
  --item-card-accent: #0c8ca8;
  --item-slot-bg: rgba(22, 161, 190, 0.62);
}

.type-spa {
  --item-card-bg: #f0dde5;
  --item-card-accent: #8f4f6c;
  --item-slot-bg: rgba(165, 101, 128, 0.62);
}

.type-shopping {
  --item-card-bg: #e6f1e8;
  --item-card-accent: #689d72;
  --item-slot-bg: rgba(127, 176, 136, 0.62);
}

.type-idea,
.type-other {
  --item-card-bg: #ffefcf;
  --item-card-accent: #d88d22;
  --item-slot-bg: rgba(240, 165, 55, 0.62);
}

.item-card:active {
  cursor: grabbing;
}

.day-items .item-card,
.basket-grid-list .item-card {
  flex: 0 0 220px;
  scroll-snap-align: start;
}

.item-card button {
  text-align: left;
}

.item-title {
  min-width: 0;
  width: 100%;
  color: var(--ink);
  font-size: 16px;
  font-weight: 900;
  line-height: 1.16;
  display: -webkit-box;
  overflow: hidden;
  min-height: 38px;
  -webkit-line-clamp: 2;
  line-clamp: 2;
  -webkit-box-orient: vertical;
}

.item-body {
  position: relative;
  min-width: 0;
  min-height: 220px;
  padding: 11px 13px 11px;
  background: var(--item-card-bg);
}

.item-top {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 78px;
  align-items: center;
  justify-content: stretch;
  gap: 8px;
}

.tile-icon {
  min-height: 44px;
  padding: 4px 13px;
  border-radius: 0;
  display: grid;
  grid-template-columns: 42px minmax(0, 1fr);
  align-items: center;
  justify-content: stretch;
  gap: 10px;
  background: var(--item-card-accent);
  color: #fff;
  font-size: 34px;
  font-weight: 700;
  text-shadow: 0 2px 0 rgba(18, 54, 61, 0.18);
  box-shadow: none;
}

.tile-icon svg {
  width: 34px;
  height: 34px;
  margin: 0 auto;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
  transform: translateY(-2px);
}

.tile-icon small {
  min-width: 0;
  display: flex;
  align-items: center;
  justify-content: flex-end;
  height: 34px;
  font-size: 22px;
  font-weight: 700;
  letter-spacing: 0.04em;
  line-height: 0.9;
  text-align: right;
  text-transform: uppercase;
  transform: translateY(-4px);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.type-ticket .tile-icon {
  background: var(--item-card-accent);
}

.type-stay .tile-icon {
  background: var(--item-card-accent);
}

.type-transport .tile-icon {
  background: var(--item-card-accent);
}

.type-excursion .tile-icon {
  background: var(--item-card-accent);
}

.type-food .tile-icon {
  background: var(--item-card-accent);
}

.type-place .tile-icon {
  background: var(--item-card-accent);
}

.type-spa .tile-icon {
  background: var(--item-card-accent);
}

.type-shopping .tile-icon {
  background: var(--item-card-accent);
}

.type-idea .tile-icon {
  background: var(--item-card-accent);
}

.item-meta {
  display: flex;
  justify-content: flex-start;
  flex-wrap: wrap;
  margin-top: 7px;
  color: var(--muted);
  font-size: 11px;
  font-weight: 700;
  gap: 5px 7px;
}

.item-content-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 58px;
  align-items: start;
  gap: 8px;
  margin-top: 4px;
}

.item-main-flow {
  min-width: 0;
}

.item-duration,
.item-date-label {
  margin: 0 0 5px;
  color: var(--item-card-accent);
  font-size: 14px;
  font-style: italic;
  font-weight: 900;
  line-height: 1;
}

.item-date-label {
  margin-top: 11px;
}

.item-time-slots,
.item-date-slots {
  display: flex;
  align-items: center;
  gap: 3px;
  min-width: 0;
}

.item-slot {
  display: inline-grid;
  place-items: center;
  min-width: 27px;
  height: 31px;
  padding: 0 4px;
  border-radius: 4px;
  background: var(--item-slot-bg);
  color: var(--ink);
  font-size: 19px;
  font-weight: 400;
  line-height: 1;
  white-space: nowrap;
}

.item-date-slots .item-slot:last-child {
  min-width: 58px;
}

.item-slot-dash,
.item-slot-separator {
  color: var(--item-card-accent);
  font-size: 19px;
  font-weight: 400;
  line-height: 1;
}

.item-slot-separator {
  align-self: flex-end;
  padding-bottom: 2px;
}

.item-side-badges {
  display: grid;
  justify-items: end;
  align-items: center;
  grid-template-rows: 31px 31px;
  gap: 30px;
  padding-top: 19px;
}

.item-side-badge {
  display: inline-grid;
  place-items: center;
  align-self: center;
  width: 36px;
  height: 36px;
  border: 0;
  border-radius: 999px;
  background: var(--item-card-accent);
  color: var(--ink);
  box-shadow: none;
  font-size: 21px;
  font-weight: 900;
}

.item-side-badge svg {
  width: 25px;
  height: 25px;
}

.item-link {
  display: inline-block;
  margin-top: 7px;
  color: var(--brand-2);
  font-size: 11px;
  font-weight: 700;
  text-decoration: underline;
  text-underline-offset: 3px;
}

.item-link-row {
  display: none;
}

.price-pill {
  display: inline-grid;
  place-items: center;
  min-height: 29px;
  padding: 3px 8px;
  border: 1px solid rgba(18, 54, 61, 0.55);
  border-radius: 4px;
  background: rgba(255, 255, 255, 0.24);
  color: var(--ink);
  font-size: 16px;
  font-weight: 900;
  white-space: nowrap;
}

.participant-chip {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  min-height: 22px;
  padding: 2px 7px 2px 3px;
  border-radius: 999px;
  background: rgba(18, 54, 61, 0.08);
  color: var(--brand);
}

.participant-avatar {
  display: inline-grid;
  place-items: center;
  width: 24px;
  height: 24px;
  flex: 0 0 24px;
  border-radius: 999px;
  color: var(--ink);
  background: #ffbe35;
  font-size: 11px;
  font-weight: 900;
  line-height: 1;
}

.participant-orange {
  background: #ff8f3d;
}

.participant-yellow {
  background: #ffcf36;
}

.participant-blue {
  background: #7fd8ee;
}

.participant-teal {
  background: #65c7a0;
}

.participant-purple {
  background: #c8a7da;
}

.participant-pink {
  background: #f7a7b6;
}

.item-note {
  margin: 11px 0 0;
  color: var(--ink);
  font-size: 13px;
  line-height: 1.22;
  display: -webkit-box;
  overflow: hidden;
  -webkit-line-clamp: 2;
  line-clamp: 2;
  -webkit-box-orient: vertical;
}

.budget-metric-group {
  display: grid;
  gap: 8px;
}

.budget-metric-group + .budget-metric-group {
  margin-top: 16px;
}

.item-source-marker {
  max-width: 100%;
  margin: 3px 0 7px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
  line-height: 1.2;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.chip,
.status-badge,
.type-badge {
  min-height: 28px;
  padding: 5px 9px;
  border: 1px solid transparent;
  border-radius: 6px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 5px;
  font-size: 12px;
  font-weight: 700;
  white-space: nowrap;
}

.status-icon {
  width: 31px;
  height: 31px;
  border: 2px solid rgba(18, 54, 61, 0.5);
  border-radius: 7px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  font-size: 20px;
  font-weight: 700;
  line-height: 1;
  color: var(--ink);
  background: transparent;
  box-shadow: none;
}

.status-icon svg {
  width: 21px;
  height: 21px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2.25;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.status-icon img {
  display: block;
  width: 25px;
  height: 25px;
  object-fit: contain;
}

.type-badge {
  color: var(--brand);
  background: var(--brand-soft);
}

.status-paid {
  color: var(--ink);
  background: transparent;
}

.status-fixed {
  color: var(--ink);
  background: transparent;
}

.status-want {
  color: var(--ink);
  background: transparent;
}

.status-maybe {
  color: var(--ink);
  background: transparent;
}

.status-backup {
  color: var(--ink);
  background: transparent;
}

.status-skipped {
  color: var(--ink);
  background: transparent;
  text-decoration: line-through;
}

.item-card .item-side-badges .item-side-badge,
.item-card .item-side-badges .item-side-badge.status-icon,
.item-card .item-side-badges .item-participant-badge {
  display: inline-grid;
  place-items: center;
  width: 36px;
  min-width: 36px;
  height: 36px;
  min-height: 36px;
  padding: 0;
  border: 0;
  border-radius: 999px;
  background: var(--item-card-accent);
  color: #fff;
  box-shadow: none;
  text-decoration: none;
  text-shadow: none;
}

.item-card .item-side-badges .item-side-badge.status-icon svg {
  width: 25px;
  height: 25px;
}

.item-card .item-side-badges .item-side-badge.status-icon img {
  width: 25px;
  height: 25px;
  filter: invert(1);
}

.item-card .item-side-badges .item-participant-badge {
  font-size: 21px;
  font-weight: 900;
  line-height: 1;
}

.item-participant-stack {
  display: inline-flex;
  flex-direction: row-reverse;
  align-items: center;
  justify-content: flex-end;
  min-width: 36px;
}

.item-participant-stack .item-participant-badge {
  position: relative;
  border: 2px solid rgba(255, 255, 255, 0.72);
}

.item-participant-stack .item-participant-badge + .item-participant-badge {
  margin-right: -13px;
}

.item-participant-more {
  background: var(--brand) !important;
  font-size: 14px !important;
}

.item-allocation-summary,
.accepted-expense-controls,
.estimate-proposal-controls {
  grid-column: 1 / -1;
}

.item-allocation-summary {
  margin: -3px 0 2px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 800;
  line-height: 1.25;
}

.accepted-expense-card,
.estimate-proposal-action {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 9px;
  border: 1px solid rgba(18, 54, 61, 0.14);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.45);
}

.accepted-expense-card p,
.estimate-proposal-action p {
  margin: 3px 0 0;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.estimate-proposal-controls {
  display: grid;
  gap: 8px;
  margin-top: 10px;
}

.primary-button,
.ghost-button,
.danger-button,
.icon-button,
.nav-button,
.chip {
  border-radius: 6px;
  border: 1px solid transparent;
  min-height: 40px;
  padding: 0 14px;
  font-weight: 700;
  /* Контейнеры с длинным AI-текстом ставят overflow-wrap: anywhere, а свойство
     наследуется — без этого сброса «Удалить» рвётся по буквам в столбик.
     Перенос между словами остаётся: длинному переводу нужны две строки. */
  overflow-wrap: normal;
}

.primary-button {
  background: var(--brand);
  color: #fff;
}

.primary-button:active,
.ghost-button:active,
.icon-button:active,
.nav-button:active,
.chip:active {
  transform: translateY(1px);
}

.ghost-button,
.icon-button {
  border-color: var(--line);
  background: var(--panel);
  color: var(--ink);
}

.header-actions .ghost-button,
.header-actions .icon-button,
.header-actions .telegram-icon-button,
.ideas-back-button,
.home-share-button,
.section-heading .primary-button[data-action="add"],
#copyEstimateButton,
#copyDaysButton,
#refreshRatesButton,
#openLinkButton,
#copyItemButton,
#tripForm .primary-button[type="submit"] {
  border-color: rgba(18, 54, 61, 0.34);
  background: var(--active-button-gradient);
  color: #fff;
  box-shadow: var(--active-button-shadow);
}

.danger-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 141px;
  border-color: #e00000;
  background: #e00000;
  color: #fff;
  box-shadow: 4px 4px 0 rgba(224, 0, 0, 0.14);
}

#itemForm .form-actions .primary-button {
  min-width: 141px;
  border-color: rgba(18, 54, 61, 0.34);
  background: var(--active-button-gradient);
  color: #fff;
  box-shadow: var(--active-button-shadow);
}

.compact {
  min-height: 36px;
}

#copyEstimateButton,
#copyDaysButton,
#refreshRatesButton,
#openLinkButton,
#copyItemButton,
#tripForm .primary-button[type="submit"] {
  min-height: 40px;
  border-color: rgba(18, 54, 61, 0.34);
  background: var(--active-button-gradient);
  color: #fff;
  box-shadow: var(--active-button-shadow);
}

.icon-button {
  width: 40px;
  min-width: 40px;
  height: 40px;
  min-height: 40px;
  padding: 0;
  display: grid;
  place-items: center;
  font-size: 18px;
  line-height: 1;
}

.ideas-back-button {
  width: 40px;
  min-width: 40px;
  height: 40px;
  min-height: 40px;
  padding: 0;
}

.item-copy-button {
  margin-left: auto;
}

.item-copy-button img {
  display: block;
  width: 25px;
  height: 25px;
  object-fit: contain;
  filter: invert(1) brightness(2);
}

.link-open-button {
  align-self: end;
  min-height: 42px;
  margin-top: 17px;
}

#editTripButton {
  position: relative;
  color: transparent;
  font-size: 0;
}

#editTripButton::before {
  content: "⚙";
  position: absolute;
  top: 50%;
  left: 50%;
  color: #fff;
  font-size: 34px;
  line-height: 1;
  transform: translate(-50%, -50%);
}

.share-icon-button svg {
  width: 26px;
  height: 26px;
}

.share-icon-button path {
  fill: none;
  stroke: #fff;
  stroke-width: 2.7;
  stroke-linecap: round;
}

.share-icon-button circle {
  fill: #fff;
  stroke: none;
}

.telegram-icon-button {
  text-decoration: none;
}

.telegram-icon-button svg {
  width: 27px;
  height: 27px;
}

.telegram-icon-button path:first-child {
  fill: #fff;
  stroke: none;
}

.telegram-icon-button path:last-child {
  fill: none;
  stroke: rgba(18, 54, 61, 0.54);
  stroke-width: 1.2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.fab {
  position: fixed;
  right: 18px;
  bottom: 82px;
  z-index: 8;
  width: 58px;
  height: 58px;
  aspect-ratio: 1;
  padding: 0;
  border: 1px solid rgba(18, 54, 61, 0.34);
  border-radius: 15px;
  background: var(--active-button-gradient);
  color: #fff;
  box-shadow: var(--active-button-shadow);
  display: grid;
  place-items: center;
}

.fab svg {
  width: 31px;
  height: 31px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2.8;
  stroke-linecap: round;
}

.bottom-nav {
  position: fixed;
  right: max(14px, calc((100vw - 760px) / 2 + 14px));
  bottom: 12px;
  left: max(14px, calc((100vw - 760px) / 2 + 14px));
  z-index: 30;
  background:
    var(--app-gradient),
    var(--panel);
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 8px;
  padding: 6px 8px;
  border: 1px solid rgba(18, 54, 61, 0.12);
  border-radius: 8px;
  box-shadow:
    0 -10px 24px rgba(18, 54, 61, 0.16),
    inset 0 1px 0 rgba(255, 255, 255, 0.82),
    inset 0 -10px 18px rgba(18, 54, 61, 0.05);
}

.nav-button {
  display: grid;
  min-height: 45px;
  place-items: center;
  align-content: center;
  padding: 6px;
  border: 1px solid rgba(18, 54, 61, 0.22);
  border-radius: 8px;
  background:
    var(--app-gradient),
    var(--panel);
  color: var(--nav-icon);
  text-align: center;
  text-decoration: none;
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.85),
    inset 0 -8px 16px rgba(18, 54, 61, 0.05),
    4px 4px 0 rgba(18, 54, 61, 0.08);
}

.nav-button span {
  display: grid;
  place-items: center;
  line-height: 1;
}

.nav-button svg {
  width: 30px;
  height: 30px;
  fill: none;
  stroke: var(--nav-icon);
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.nav-button.active {
  background: var(--active-button-gradient);
  border-color: rgba(18, 54, 61, 0.42);
  color: #fff;
  box-shadow: var(--active-button-shadow);
}

.nav-button.active svg {
  stroke: #fff;
}

.unscheduled-card {
  margin-top: 12px;
}

#unscheduledPreview {
  padding: 14px 16px 12px;
  scroll-padding-inline: 16px;
}

#unscheduledPreview .item-card {
  margin: 0;
}

.drop-target-active {
  outline: 2px dashed var(--brand);
  outline-offset: -4px;
  background: rgba(46, 196, 214, 0.08);
}

.dragging-source {
  opacity: 0.45;
}

.drag-ghost {
  position: fixed;
  z-index: 50;
  pointer-events: none;
  opacity: 0.92;
  transform-origin: top left;
  box-shadow: 0 18px 45px rgba(18, 54, 61, 0.28);
}

.filter-row {
  display: flex;
  gap: 8px;
  margin: 0 -14px 12px;
  padding: 0 14px 4px;
  overflow-x: auto;
  scrollbar-width: auto;
  scrollbar-color: #6f7877 rgba(18, 54, 61, 0.08);
}

.chip {
  border-color: rgba(18, 54, 61, 0.16);
  background:
    var(--app-gradient),
    var(--panel);
  color: var(--nav-icon);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.62),
    inset -5px -5px 10px rgba(18, 54, 61, 0.05);
}

.filter-chip {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  white-space: nowrap;
}

.filter-status-icon {
  display: inline-grid;
  place-items: center;
  width: 18px;
  height: 18px;
  flex: 0 0 18px;
}

.filter-status-icon img {
  display: block;
  width: 17px;
  height: 17px;
  object-fit: contain;
}

.filter-chip.active .filter-status-icon img {
  filter: invert(1);
}

.chip.active {
  background: var(--active-button-gradient);
  color: #fff;
  border-color: rgba(18, 54, 61, 0.42);
  box-shadow:
    inset 1px 1px 0 rgba(255, 255, 255, 0.16),
    inset -6px -6px 12px rgba(0, 0, 0, 0.16);
}

.basket-group {
  display: grid;
  gap: 8px;
}

.basket-grid-list {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  scroll-snap-type: x mandatory;
  scrollbar-width: auto;
  scrollbar-color: #6f7877 rgba(18, 54, 61, 0.08);
}

.currency-card {
  padding: 12px;
  border-color: rgba(18, 54, 61, 0.16);
  background:
    var(--app-gradient),
    var(--panel);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.72),
    inset 0 -10px 18px rgba(18, 54, 61, 0.05),
    6px 6px 0 rgba(18, 54, 61, 0.09);
  display: grid;
  /* Средняя колонка отдана кнопке смены направления. Крайние ужимаются
     наравне, поэтому подписи валют не переносятся даже на 360px. */
  grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr);
  gap: 12px;
}

.currency-card .field {
  color: var(--brand);
}

.currency-card input,
.currency-card select {
  border-color: rgba(18, 54, 61, 0.22);
  background: rgba(255, 255, 255, 0.88);
  box-shadow:
    inset 1px 1px 0 rgba(255, 255, 255, 0.8),
    inset -4px -4px 8px rgba(18, 54, 61, 0.035);
}

/* Высота как у слотов и кнопки «Обновить»: восемьдесят четыре пикселя
   отводились под одну строку и разрывали ритм экрана. */
.currency-result {
  grid-column: 1 / -1;
  min-height: 42px;
  padding: 6px 14px;
  border: 1px solid rgba(18, 54, 61, 0.34);
  border-radius: 6px;
  background: var(--active-button-gradient);
  color: #fff;
  box-shadow:
    inset 1px 1px 0 rgba(255, 255, 255, 0.16),
    inset -10px -10px 18px rgba(0, 0, 0, 0.18);
  display: grid;
  place-items: center;
  font-size: 22px;
  font-weight: 700;
  line-height: 1.1;
  text-align: center;
}

.budget-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.budget-grid .metric-card:first-child,
.budget-grid .metric-card:last-child {
  grid-column: 1 / -1;
}

.additional-budget-grid .metric-card:last-child {
  grid-column: auto;
}

.budget-days-card {
  padding: 12px;
  display: grid;
  gap: 8px;
}

.title-actions {
  display: inline-flex;
  align-items: center;
  gap: 10px;
}

.metric-card.service-total {
  border-color: rgba(18, 54, 61, 0.42);
  background: var(--active-button-gradient);
  color: #fff;
  box-shadow: var(--active-button-shadow);
}

.metric-card.service-total span,
.metric-card.service-total strong {
  color: #fff;
}

.metric-card.service-total strong {
  font-size: 22px;
}

.budget-row {
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--panel);
}

.budget-row strong {
  font-size: 15px;
}

.estimate-table-wrap {
  margin-top: 12px;
  overflow-x: auto;
}

.estimate-table {
  width: 100%;
  min-width: 720px;
  border-collapse: collapse;
  font-size: 13px;
}

.estimate-table th,
.estimate-table td {
  padding: 9px 8px;
  border-bottom: 1px solid var(--line);
  text-align: left;
  vertical-align: top;
}

.estimate-table th {
  color: var(--muted);
  background: var(--panel);
  font-size: 11px;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

.estimate-table a {
  color: var(--brand-2);
  font-weight: 700;
  text-decoration: underline;
  text-underline-offset: 3px;
}

.sheet {
  position: fixed;
  inset: 0;
  z-index: 70;
  display: none;
}

.sheet.open {
  display: block;
}

.sheet-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(35, 35, 31, 0.42);
}

.sheet-panel {
  position: absolute;
  right: 0;
  bottom: 0;
  left: 0;
  max-height: min(88vh, 760px);
  padding: 14px;
  border-radius: 18px 18px 0 0;
  background: var(--panel);
  overflow: auto;
  box-shadow: 0 -18px 45px rgba(35, 35, 31, 0.24);
}

.trip-draft-ai-panel {
  max-height: min(92vh, 780px);
  padding-top: 12px;
}

.trip-draft-ai-panel,
.trip-draft-ai-panel * {
  box-sizing: border-box;
  min-width: 0;
}

.trip-draft-ai-body,
.trip-draft-input,
.trip-draft-preview {
  display: grid;
  gap: 12px;
  width: 100%;
  max-width: 100%;
}

.trip-draft-choice-grid {
  display: grid;
  gap: 8px;
}

.trip-draft-choice {
  min-height: 52px;
  justify-content: center;
  border-color: rgba(18, 54, 61, 0.34);
  background: var(--active-button-gradient);
  box-shadow: var(--active-button-shadow);
  color: #fff;
  font-weight: 900;
}

.trip-draft-ai-panel .primary-button,
.trip-draft-ai-panel .ghost-button {
  border-color: rgba(18, 54, 61, 0.34);
  background: var(--active-button-gradient);
  box-shadow: var(--active-button-shadow);
  color: #fff;
  font-weight: 900;
}

.trip-draft-ai-panel .primary-button:disabled,
.trip-draft-ai-panel .ghost-button:disabled {
  opacity: 0.55;
  box-shadow: none;
}

.trip-draft-copy {
  margin: 0;
  color: var(--muted);
  font-weight: 400;
  line-height: 1.15;
}

.trip-draft-copy strong {
  display: block;
  margin-bottom: 0.35em;
  font-weight: 800;
}

.trip-draft-voice-controls,
/* Mobile-first: one column. Two columns left «Создать поездку» four pixels of slack at
   375px, so any enlarged system font pushed it onto two or three lines. */
.trip-draft-actions {
  display: grid;
  grid-template-columns: 1fr;
  gap: 10px;
  align-items: center;
}

/* The main action leads and spans the full width; secondary actions sit under it. */
.trip-draft-actions .primary-button {
  order: -1;
}

.trip-draft-actions {
  position: sticky;
  bottom: -14px;
  z-index: 1;
  padding: 10px 0 calc(10px + env(safe-area-inset-bottom));
  background: var(--panel);
}

.trip-draft-recording-indicator {
  color: var(--danger);
  font-weight: 900;
}

.trip-draft-status {
  min-height: 20px;
  margin: 0;
  color: var(--muted);
  font-weight: 800;
}

.trip-draft-status.is-error {
  color: var(--danger);
}

.trip-draft-preview-box {
  display: grid;
  gap: 10px;
}

.trip-draft-preview-card {
  width: 100%;
  max-width: 100%;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.62);
  overflow-wrap: anywhere;
}

.trip-draft-preview-card h3 {
  margin: 0 0 8px;
  color: var(--text);
  font-size: 17px;
}

.trip-draft-preview-card p,
.trip-draft-preview-card ul {
  margin: 0;
  color: var(--muted);
  font-weight: 700;
  line-height: 1.45;
}

.trip-draft-preview-card ul {
  padding-left: 18px;
}

.trip-draft-date-note {
  margin-top: 10px;
}

.trip-draft-field-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.trip-draft-preferences-field,
.trip-draft-source,
.ai-source-field {
  margin-top: 10px;
}

.trip-draft-source {
  width: 100%;
  max-width: 100%;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.62);
  overflow-wrap: anywhere;
}

.trip-draft-source summary {
  cursor: pointer;
  color: var(--text);
  font-weight: 900;
}

.trip-draft-source textarea,
.ai-source-field textarea {
  width: 100%;
  max-width: 100%;
  margin-top: 10px;
}

.trip-draft-source-actions {
  display: grid;
  grid-template-columns: 1fr;
  gap: 10px;
  margin-top: 10px;
}

/* «Пересобрать черновик» needs about 217px with its padding, so two columns are only safe
   from roughly 470px onward. Below that the labels are the constraint, not the screen. */
@media (min-width: 480px) {
  .trip-draft-actions,
  .trip-draft-source-actions {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .trip-draft-actions .primary-button {
    order: 0;
  }
}

.trip-draft-items-editor {
  display: grid;
  gap: 12px;
}

.trip-draft-item-editor {
  display: grid;
  gap: 10px;
  width: 100%;
  max-width: 100%;
  padding: 10px;
  border: 1px solid rgba(18, 54, 61, 0.14);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.48);
}

.trip-draft-item-header {
  display: flex;
  gap: 10px;
  /* Кнопка держится первой строки, когда название занимает несколько. */
  align-items: flex-start;
  justify-content: space-between;
  max-width: 100%;
}

/* Название события переносится на несколько строк вместо обрезки: у поездов
   и рейсов начало строки одинаковое, и по многоточию их не различить. */
.trip-draft-item-header strong {
  min-width: 0;
  color: var(--ink);
  overflow-wrap: anywhere;
}

/* Сжимать нужно название, а не кнопку. */
.trip-draft-item-header .ghost-button {
  flex-shrink: 0;
}

@media (max-width: 430px) {
  .trip-draft-field-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 360px) {
  .trip-draft-voice-controls {
    grid-template-columns: 1fr;
  }
}

.export-format-dialog {
  position: fixed;
  inset: 0;
  z-index: 80;
  display: grid;
  place-items: center;
}

.export-format-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(35, 35, 31, 0.42);
}

.export-format-panel {
  position: relative;
  z-index: 1;
  width: min(360px, calc(100vw - 34px));
  padding: 18px;
  border-radius: 18px;
  background: var(--panel);
  box-shadow: 0 18px 45px rgba(35, 35, 31, 0.24);
}

.export-format-panel h2 {
  margin: 0 0 14px;
  color: var(--text);
  font-size: 19px;
}

.export-format-actions {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.export-format-button,
.export-format-cancel {
  min-height: 46px;
  border-radius: 8px;
  font: inherit;
  font-weight: 800;
  cursor: pointer;
}

.export-format-button {
  border: 1px solid rgba(39, 48, 45, 0.16);
  color: #ffffff;
  background: var(--active-button-gradient);
  box-shadow: var(--active-button-shadow);
}

.export-format-cancel {
  width: 100%;
  margin-top: 10px;
  border: 1px solid rgba(39, 48, 45, 0.14);
  color: var(--text);
  background: transparent;
}

.add-participant-dialog {
  position: fixed;
  inset: 0;
  z-index: 50;
  display: grid;
  place-items: center;
}

.add-participant-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(35, 35, 31, 0.42);
}

.add-participant-panel {
  position: relative;
  z-index: 1;
  display: grid;
  gap: 14px;
  width: min(360px, calc(100vw - 34px));
  padding: 18px;
  border-radius: 18px;
  background: var(--panel);
  box-shadow: 0 18px 45px rgba(35, 35, 31, 0.24);
}

.add-participant-panel h2 {
  margin: 0;
  color: var(--text);
  font-size: 19px;
}

.add-participant-actions {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.add-participant-actions .primary-button,
.add-participant-actions .ghost-button {
  min-height: 46px;
}

.add-participant-actions .primary-button {
  border: 1px solid rgba(39, 48, 45, 0.16);
  color: #ffffff;
  background: var(--active-button-gradient);
  box-shadow: var(--active-button-shadow);
}

.add-participant-actions .ghost-button {
  border: 1px solid rgba(39, 48, 45, 0.14);
  background: transparent;
  box-shadow: none;
}

.sheet-header {
  margin-bottom: 14px;
}

.sheet-form {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  align-items: start;
  gap: 10px;
}

.sheet-form > .field,
.sheet-form > .field > input,
.sheet-form > .field > select,
.sheet-form > .field > textarea {
  min-width: 0;
  max-width: 100%;
}

.field {
  display: grid;
  gap: 5px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

.duration-fields {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: 8px;
}

.duration-field {
  display: grid;
  grid-template-columns: minmax(0, 64px) 34px;
  align-items: center;
  gap: 6px;
}

.duration-field input {
  width: 100%;
}

.duration-field span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

.field.wide,
.item-draft-warning,
.form-actions {
  grid-column: 1 / -1;
}

.field-hint {
  margin: 0;
  color: var(--muted);
  font-size: 11px;
  font-weight: 400;
  line-height: 1.35;
}

.field-hint.wide {
  grid-column: 1 / -1;
}

.link-intake-panel {
  display: grid;
  grid-column: 1 / -1;
  gap: 8px;
  padding: 10px;
  border: 1px solid rgba(18, 54, 61, 0.12);
  border-radius: 14px;
  background: rgba(216, 242, 237, 0.44);
}

.item-attachments {
  display: grid;
  grid-column: 1 / -1;
  gap: 10px;
  padding: 12px;
  border: 1px solid rgba(18, 54, 61, 0.14);
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.58);
}

.item-attachments.hidden {
  display: none;
}

.item-attachments-header {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 10px;
}

.item-attachments-header h3 {
  margin: 0;
  color: var(--ink);
  font-size: 15px;
}

.item-attachments-status {
  color: var(--muted);
  font-size: 12px;
  text-align: right;
}

.item-attachments-status.is-error,
.item-attachment-error {
  color: #9a2e26;
}

.item-attachments-list {
  display: grid;
  gap: 8px;
}

.item-attachment-empty,
.item-attachment-error {
  margin: 0;
  font-size: 13px;
}

.item-attachment-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 10px;
  padding: 10px;
  border: 1px solid rgba(18, 54, 61, 0.12);
  border-radius: 12px;
  background: #fff;
}

/* A photo attachment leads with the picture; the file name stays as the caption. */
.item-attachment-row.has-thumb {
  grid-template-columns: auto minmax(0, 1fr) auto;
}

.item-attachment-thumb {
  display: block;
  width: 52px;
  height: 52px;
  padding: 0;
  overflow: hidden;
  border: 1px solid rgba(18, 54, 61, 0.12);
  border-radius: 8px;
  background: rgba(18, 54, 61, 0.06);
  cursor: pointer;
}

.item-attachment-thumb:disabled {
  cursor: default;
  opacity: 0.5;
}

.item-attachment-thumb.is-loading {
  animation: attachment-thumb-pulse 1.2s ease-in-out infinite;
}

.item-attachment-thumb img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

@keyframes attachment-thumb-pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.55; }
}

@media (prefers-reduced-motion: reduce) {
  .item-attachment-thumb.is-loading {
    animation: none;
  }
}

.item-attachment-copy {
  min-width: 0;
}

.item-attachment-name {
  display: block;
  overflow: hidden;
  color: var(--ink);
  font-size: 13px;
  font-weight: 700;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* The thumbnail makes the row tall enough for a second line, so a camera file name
   like IMG_20260804_102714_170.jpg can be read instead of ending in an ellipsis. */
.item-attachment-row.has-thumb .item-attachment-name {
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 3;
  line-clamp: 3;
  white-space: normal;
  word-break: break-word;
}

.item-attachment-meta {
  display: block;
  margin-top: 2px;
  color: var(--muted);
  font-size: 11px;
}

.item-attachment-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 6px;
}

.item-attachment-add,
.item-attachment-retry {
  min-height: 36px;
  border-radius: 999px;
}

.item-attachment-action {
  flex: 0 0 auto;
  width: 40px;
  min-width: 40px;
  height: 40px;
  min-height: 40px;
  border-radius: 999px;
}

.item-attachment-action svg {
  width: 19px;
  height: 19px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.item-attachment-action:disabled {
  cursor: default;
  opacity: 0.45;
}

.item-attachment-delete {
  color: #8b2f28;
  border-color: rgba(139, 47, 40, 0.35);
}

.item-attachment-add {
  justify-self: start;
}

.link-intake-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

.link-intake-actions .ghost-button {
  flex: 0 0 auto;
}

.link-intake-status {
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
  line-height: 1.25;
}

.link-intake-status.is-error {
  color: var(--danger);
}

.link-intake-hint {
  margin: 0;
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
  line-height: 1.35;
}

.link-intake-preview {
  display: grid;
  gap: 8px;
}

.link-intake-preview-card {
  display: grid;
  gap: 8px;
  padding: 10px;
  border: 1px solid rgba(18, 54, 61, 0.12);
  border-radius: 12px;
  background: rgba(255, 253, 248, 0.94);
}

.link-intake-image-preview {
  overflow: hidden;
  border-radius: 10px;
  background: rgba(18, 54, 61, 0.08);
}

.link-intake-image-preview img {
  display: block;
  width: 100%;
  max-height: 150px;
  object-fit: cover;
}

.link-intake-preview-title {
  margin: 0;
  color: var(--brand);
  font-size: 13px;
  font-weight: 900;
  line-height: 1.25;
}

.link-intake-preview-copy,
.link-intake-preview-warning {
  margin: 0;
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
  line-height: 1.35;
}

.link-intake-preview-warning {
  color: var(--amber);
}

.participants-field {
  grid-column: 1 / -1;
}

.participants-section {
  display: grid;
  gap: 10px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #fff;
  padding: 10px;
}

.participants-actions,
.participant-total-row,
.participant-row {
  display: flex;
  align-items: center;
  gap: 8px;
}

.participants-actions .ghost-button {
  width: 100%;
  min-height: 44px;
}

.participants-list {
  display: grid;
  gap: 8px;
}

.participant-row {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  min-width: 0;
  min-height: 40px;
  padding: 4px 0;
  border: 0;
  background: transparent;
}

.participant-row-text {
  display: grid;
  min-width: 0;
  line-height: 1.2;
}

.participant-row-text strong {
  overflow: hidden;
  color: var(--ink);
  font-size: 13px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.participant-row-text strong span {
  color: var(--muted);
  font-size: 11px;
  font-weight: 700;
}

.participant-row-text span,
.participant-total-row em {
  color: var(--muted);
  font-size: 11px;
  font-style: normal;
  font-weight: 700;
}

.participant-delete-button {
  min-width: 0;
}

.participant-row-actions {
  display: flex;
  grid-column: 3;
  gap: 6px;
  justify-self: end;
}

.participant-row-actions .ghost-button,
.participant-row-actions .danger-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  box-sizing: border-box;
  width: 104px;
  min-width: 104px;
  min-height: 34px;
  padding-right: 4px;
  padding-left: 4px;
  font-size: 11px;
  white-space: nowrap;
  text-align: center;
  line-height: 1;
}

.participant-editor-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto auto;
  align-items: end;
  gap: 8px;
  padding: 6px 0 2px;
}

.participant-editor-field {
  min-width: 0;
}

.participant-editor-row .ghost-button {
  min-width: 112px;
}

@media (max-width: 420px) {
  .participant-row {
    grid-template-columns: auto minmax(0, 1fr) auto;
  }

  .participant-row-actions {
    grid-column: 3;
    justify-self: end;
  }

  .participant-row-actions .ghost-button,
  .participant-row-actions .danger-button {
    width: 104px;
    min-width: 104px;
  }

  .participant-editor-row {
    grid-template-columns: minmax(0, 1fr);
  }
}

.participant-totals-card {
  display: grid;
  gap: 8px;
  margin-top: 12px;
  padding: 12px;
}

.participant-total-row {
  justify-content: space-between;
  min-height: 40px;
  padding: 8px 0;
  border-top: 1px solid rgba(18, 54, 61, 0.1);
}

.participant-total-row > span {
  display: inline-flex;
  align-items: center;
  min-width: 0;
  gap: 6px;
  color: var(--ink);
  font-weight: 800;
}

.participant-total-row strong {
  flex-shrink: 0;
}

input,
select,
textarea {
  width: 100%;
  min-height: 42px;
  padding: 9px 10px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #fff;
  color: var(--ink);
  outline: none;
}

textarea {
  resize: vertical;
}

input:focus,
select:focus,
textarea:focus {
  border-color: var(--brand-2);
  box-shadow: 0 0 0 3px rgba(63, 109, 96, 0.14);
}

.form-actions {
  margin-top: 4px;
}

#itemForm .form-actions {
  position: sticky;
  bottom: -14px;
  z-index: 2;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(96px, 1fr));
  gap: 10px;
  margin: 8px -14px -14px;
  padding: 12px 14px calc(12px + env(safe-area-inset-bottom));
  background:
    linear-gradient(180deg, rgba(248, 244, 234, 0), var(--panel) 20%),
    var(--panel);
  border-top: 1px solid rgba(222, 216, 204, 0.85);
}

#itemForm .form-actions .primary-button,
#itemForm .form-actions .danger-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 0;
  width: 100%;
  padding: 0 10px;
  line-height: 1;
  text-align: center;
}

#tripForm .form-actions .ghost-button,
#tripForm .form-actions .primary-button {
  display: inline-grid;
  place-items: center;
  text-align: center;
  line-height: 1;
}

.share-actions {
  display: grid;
  gap: 10px;
  margin-bottom: 12px;
}

.share-mode-card {
  display: grid;
  min-width: 0;
  gap: 8px;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.72);
}

.share-mode-card.hidden,
.group-trip-participants.hidden {
  display: none;
}

.share-mode-card > h3,
.share-mode-panel > h3 {
  margin: 0;
  font-size: 15px;
  line-height: 1.35;
}

.share-mode-card > .field-hint,
.share-mode-panel > .share-mode-explanation {
  margin: 0;
}

.share-mode-card > .primary-button {
  width: 100%;
}

.share-mode-card > .primary-button.is-active {
  box-shadow: inset 0 0 0 2px rgba(255, 255, 255, 0.42);
}

.share-mode-panel {
  display: grid;
  min-width: 0;
  gap: 10px;
  margin-top: 2px;
  padding-top: 10px;
  border-top: 1px solid var(--line);
}

.share-mode-panel.hidden,
.share-mode-switch-confirm.hidden {
  display: none;
}

.share-mode-switch-confirm {
  display: grid;
  gap: 10px;
  padding: 12px;
  border: 1px solid var(--accent);
  border-radius: 8px;
  background: rgba(47, 101, 92, 0.08);
}

.share-mode-switch-confirm p {
  margin: 0;
  font-size: 14px;
  line-height: 1.45;
}

.share-mode-switch-actions {
  display: grid;
  gap: 8px;
}

.share-mode-switch-actions button {
  width: 100%;
}

.group-trip-participants {
  display: grid;
  gap: 6px;
  padding-top: 8px;
  border-top: 1px solid var(--line);
  font-size: 13px;
  line-height: 1.45;
}

.group-trip-participants strong {
  font-weight: 700;
}

.group-trip-participants ul {
  display: grid;
  gap: 5px;
  margin: 0;
  padding-left: 20px;
  font-weight: 400;
}

.group-trip-participant-empty {
  color: var(--muted);
  font-weight: 700;
}

.organizer-program-form,
.organizer-group-materials {
  display: grid;
  gap: 9px;
  padding-top: 10px;
  border-top: 1px solid var(--line);
}

.organizer-program-form > h3,
.organizer-group-materials > h3 {
  margin: 0;
  font-size: 15px;
  line-height: 1.35;
}

.organizer-program-price {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 88px;
  gap: 8px;
}

.organizer-program-price > .field {
  min-width: 0;
}

.organizer-program-price > .field > span {
  min-height: 2.7em;
}

#organizerProgramPriceAmount,
#organizerProgramPriceCurrency {
  height: 42px;
  min-height: 42px;
}

.organizer-program-form textarea {
  width: 100%;
  min-width: 0;
  resize: vertical;
}

.organizer-program-currency select {
  width: 100%;
}

.organizer-group-materials-list {
  display: grid;
  gap: 6px;
}

.organizer-group-material-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 34px;
  align-items: center;
  gap: 6px;
}

.organizer-group-material-name {
  min-width: 0;
  padding: 7px 9px;
  overflow: hidden;
  border: 1px solid rgba(18, 54, 61, 0.16);
  border-radius: 6px;
  background: rgba(255, 255, 255, 0.72);
  color: var(--brand);
  font: inherit;
  font-size: 13px;
  font-weight: 700;
  text-align: left;
  text-overflow: ellipsis;
  white-space: nowrap;
  cursor: pointer;
}

.organizer-group-material-delete {
  width: 34px;
  height: 34px;
  min-height: 34px;
  color: var(--danger);
}

.participant-program-info {
  display: grid;
  gap: 12px;
  margin-bottom: 14px;
}

.participant-program-info.hidden {
  display: none;
}

.participant-program-heading {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 10px;
}

.participant-program-heading h2 {
  margin: 0;
  font-size: 18px;
}

.participant-program-heading span {
  flex-shrink: 0;
  color: var(--muted);
  font-size: 11px;
  line-height: 1.35;
  text-align: right;
}

#participantProgramInfoContent {
  display: grid;
  gap: 11px;
}

#participantProgramInfoContent > div {
  display: grid;
  gap: 3px;
}

#participantProgramInfoContent strong {
  color: var(--ink);
  font-size: 13px;
}

#participantProgramInfoContent p {
  margin: 0;
  color: var(--text);
  font-size: 14px;
  line-height: 1.45;
}

.participant-program-materials button {
  width: 100%;
  padding: 8px 0;
  overflow-wrap: anywhere;
  border: 0;
  border-bottom: 1px solid var(--line);
  background: transparent;
  color: var(--brand);
  font: inherit;
  font-size: 14px;
  font-weight: 700;
  text-align: left;
  cursor: pointer;
}

/* The participant projection is truly read-only: the FAB's authored display
   must not override the native hidden attribute set by showTripScreen(). */
.fab[hidden] {
  display: none;
}

.share-secondary-actions {
  margin-top: 8px;
}

.trip-pdf-options {
  display: grid;
  gap: 10px;
  margin: 0 0 12px;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
}

.trip-link-options {
  display: grid;
  min-width: 0;
  gap: 10px;
  margin: -2px 0 2px;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
}

.trip-link-options.hidden {
  display: none;
}

.share-link-box {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 8px;
  align-items: center;
}

.share-link-box input {
  min-width: 0;
  height: 42px;
  padding: 0 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  color: var(--ink);
  font: inherit;
}

#copyTripLinkButton {
  min-height: 42px;
  border-color: rgba(18, 54, 61, 0.34);
  background: var(--active-button-gradient);
  color: #fff;
  box-shadow: var(--active-button-shadow);
  font-weight: 900;
}

@media (max-width: 380px) {
  .share-link-box {
    grid-template-columns: minmax(0, 1fr);
  }

  #copyTripLinkButton {
    width: 100%;
  }
}

#copyTripLinkButton:disabled {
  opacity: 0.55;
  box-shadow: none;
}

.share-link-hint {
  margin: -2px 2px 0;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.35;
}

.share-link-status {
  min-height: 17px;
  margin: -2px 2px 0;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
  line-height: 1.35;
}

.share-link-status.error {
  color: var(--danger);
}

.trip-pdf-options.hidden {
  display: none;
}

.trip-pdf-toggle {
  display: grid;
  grid-template-columns: 24px minmax(0, 1fr);
  align-items: center;
  gap: 9px;
  min-height: 40px;
  padding: 6px 8px;
  border: 1px solid rgba(18, 54, 61, 0.12);
  border-radius: 8px;
  background:
    var(--app-gradient),
    var(--panel);
  color: var(--ink);
  font-size: 13px;
  font-weight: 800;
}

.trip-pdf-toggle input {
  width: 20px;
  min-width: 20px;
  height: 20px;
  min-height: 20px;
  margin: 0;
  accent-color: var(--brand);
}

.trip-pdf-actions {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.trip-pdf-options .primary-button {
  display: grid;
  width: 100%;
  min-height: 45px;
  justify-self: center;
  place-items: center;
  border-color: rgba(18, 54, 61, 0.34);
  background: var(--active-button-gradient);
  color: #fff;
  box-shadow: var(--active-button-shadow);
  line-height: 1;
  text-align: center;
}

#homeShareSheet .sheet-panel {
  min-height: min(50vh, 360px);
  padding-bottom: calc(34px + env(safe-area-inset-bottom));
}

#homeShareSheet .share-actions {
  margin-bottom: 0;
}

.card-copy-panel {
  display: grid;
  gap: 12px;
  padding-bottom: 0;
}

.card-copy-body,
.card-copy-step {
  display: grid;
  gap: 10px;
}

.card-copy-step.hidden,
.card-copy-warning.hidden {
  display: none;
}

.card-copy-option {
  display: grid;
  width: 100%;
  min-height: 58px;
  gap: 4px;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  color: var(--ink);
  text-align: left;
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.82),
    3px 3px 0 rgba(18, 54, 61, 0.06);
}

.card-copy-option[aria-pressed="true"] {
  border-color: rgba(18, 54, 61, 0.34);
  background: var(--active-button-gradient);
  color: #fff;
  box-shadow: var(--active-button-shadow);
}

.card-copy-option strong {
  overflow: hidden;
  font-size: 15px;
  line-height: 1.15;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.card-copy-option span {
  overflow: hidden;
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
  line-height: 1.25;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.card-copy-option[aria-pressed="true"] span {
  color: rgba(255, 255, 255, 0.88);
}

.card-copy-warning,
.card-copy-empty {
  margin: 0;
  padding: 10px 12px;
  border: 1px solid rgba(153, 72, 43, 0.24);
  border-radius: 8px;
  background: #fff4e9;
  color: #7f3f29;
  font-size: 13px;
  font-weight: 700;
  line-height: 1.35;
}

.card-copy-empty {
  border-color: var(--line);
  background: #fff;
  color: var(--muted);
}

.card-copy-actions {
  position: sticky;
  z-index: 2;
  bottom: -14px;
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: 10px;
  margin: 2px -14px -14px;
  padding: 12px 14px calc(12px + env(safe-area-inset-bottom));
  border-top: 1px solid rgba(222, 216, 204, 0.85);
  background:
    linear-gradient(180deg, rgba(248, 244, 234, 0), var(--panel) 20%),
    var(--panel);
}

.card-copy-actions .ghost-button,
.card-copy-actions .primary-button {
  display: grid;
  width: 100%;
  min-width: 0;
  min-height: 45px;
  place-items: center;
  line-height: 1;
  text-align: center;
}

.card-copy-actions .primary-button {
  border-color: rgba(18, 54, 61, 0.34);
  background: var(--active-button-gradient);
  color: #fff;
  box-shadow: var(--active-button-shadow);
}

.card-copy-actions .ghost-button[hidden] {
  display: none;
}

.card-copy-actions:has(.ghost-button[hidden]) {
  grid-template-columns: minmax(0, 1fr);
}

.idea-sheet-panel,
.idea-collection-sheet-panel {
  max-height: min(90vh, 760px);
  padding-bottom: calc(14px + env(safe-area-inset-bottom));
}

.idea-form,
.idea-collection-form {
  padding-bottom: calc(8px + env(safe-area-inset-bottom));
}

.idea-new-collection-button {
  align-self: end;
  min-height: 40px;
  margin-top: 17px;
}

.idea-form-actions {
  position: sticky;
  bottom: -14px;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  margin: 0 -14px -14px;
  padding: 12px 14px calc(12px + env(safe-area-inset-bottom));
  border-top: 1px solid rgba(222, 216, 204, 0.85);
  background:
    linear-gradient(180deg, rgba(248, 244, 234, 0), var(--panel) 20%),
    var(--panel);
}

.idea-form-actions .primary-button,
.idea-form-actions .ghost-button,
.idea-collection-form .primary-button,
.idea-new-collection-button {
  width: 100%;
  min-width: 0;
  border-color: rgba(18, 54, 61, 0.34);
  background: var(--active-button-gradient);
  color: #fff;
  box-shadow: var(--active-button-shadow);
}

.idea-form-actions .ghost-button[hidden] {
  display: none;
}

.idea-form-actions:has(.ghost-button[hidden]) {
  grid-template-columns: minmax(0, 1fr);
}

.home-share-hint {
  display: grid;
  gap: 8px;
  max-width: 430px;
  margin: 16px 2px 0;
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
  line-height: 1.4;
}

.share-actions .primary-button,
.share-actions .ghost-button {
  min-height: 44px;
  border-color: rgba(18, 54, 61, 0.34);
  background: var(--active-button-gradient);
  color: #fff;
  box-shadow: var(--active-button-shadow);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  text-decoration: none;
}

.share-preview {
  margin: 0;
  min-height: 280px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #fff;
  color: var(--ink);
  white-space: pre-wrap;
  font: 13px/1.45 "Segoe UI", Arial, sans-serif;
}

.toast {
  position: fixed;
  right: 16px;
  bottom: 152px;
  z-index: 50;
  max-width: 280px;
  padding: 10px 12px;
  border-radius: 8px;
  background: var(--ink);
  color: #fff;
  opacity: 0;
  transform: translateY(10px);
  transition: opacity 0.2s ease, transform 0.2s ease;
  font-size: 13px;
  font-weight: 700;
  pointer-events: none;
}

.toast.visible {
  opacity: 1;
  transform: translateY(0);
}

@media (max-width: 520px) {
  .trip-header {
    padding-inline: 12px;
  }

  .brand-row {
    grid-template-columns: 40px minmax(0, 1fr) auto;
    gap: 12px;
  }

  .brand-lockup > div {
    max-width: 100%;
  }

  .header-actions {
    gap: 6px;
  }

  h1 {
    font-size: 21px;
  }
}

@media (min-width: 760px) {
  .trip-header {
    padding: 22px;
  }

  .main-content {
    padding: 22px;
  }

  .view.active#planView {
    display: block;
  }

  #planView .section-heading,
  #planView .days-list {
    grid-column: auto;
  }

  #planView .unscheduled-card {
    grid-column: auto;
    grid-row: auto;
    margin-top: 16px;
    position: static;
  }

  .days-list {
    grid-template-columns: 1fr;
  }

  .day-items {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .budget-page {
    grid-template-columns: minmax(0, 1fr) 340px;
  }

  .fab {
    right: 24px;
    bottom: 104px;
  }

  .sheet-panel {
    right: 22px;
    bottom: 22px;
    left: auto;
    width: min(620px, calc(100vw - 44px));
    border-radius: 18px;
  }
}

/* Переключатель направления в калькуляторе валют: своя строка во всю
   ширину, чтобы не спорить с двумя селектами и не зависеть от длины
   подписи при переводе. */
/* Кнопка стоит между двумя селектами и выровнена по их нижнему краю, а не
   отдельной строкой под ними: направление меняют, глядя на обе валюты.
   Имя кнопки живёт в aria-label и title — стрелки его не заменяют. */
/* Высота повторяет слоты валюты, чтобы кнопка встала с ними в один ряд,
   а заливка — как у остальных действий: плашки результата, плюса и кнопок
   шапки. Это действие, а не ещё одно поле ввода. */
.currency-swap-button {
  align-self: end;
  justify-self: center;
  width: 42px;
  min-width: 42px;
  height: 42px;
  min-height: 42px;
  padding: 0;
  border-color: rgba(18, 54, 61, 0.34);
  background: var(--active-button-gradient);
  color: #fff;
  box-shadow: var(--active-button-shadow);
  justify-content: center;
  font-size: 20px;
  line-height: 1;
}

/* Подписи «Из» и «В» центрируются над своими селектами. */
.currency-card .field {
  text-align: center;
}

.currency-card .field.wide {
  text-align: left;
}

/* Справка и «О продукте» — единый ритм текста.
   Списки набирались приглушённым коричневым и на два пункта крупнее
   абзацев, из-за чего часть разделов выпадала из общего текста,
   а абзацы шли впритык друг к другу. */
#howToSheet details p,
#productInfoSheet details p,
#howToSheet .sheet-panel > p,
#productInfoSheet .sheet-panel > p {
  margin: 0 0 14px;
  line-height: 1.5;
}

#howToSheet details ul,
#howToSheet details ol,
#productInfoSheet details ul,
#productInfoSheet details ol {
  margin: 0 0 14px;
  color: var(--ink);
  font-size: 14px;
}

#howToSheet details li,
#productInfoSheet details li {
  margin-bottom: 8px;
  color: var(--ink);
  font-size: 14px;
  line-height: 1.5;
}

#howToSheet details li:last-child,
#productInfoSheet details li:last-child {
  margin-bottom: 0;
}
/* «Картон, бумага, билеты» — палитра, шрифты, плотность теней и фактура.
   Разметка, геометрия карточек, горизонтальная лента дня и состав строк
   не менялись: правил про размер, отступ и порядок здесь нет. */

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

@font-face {
  font-family: Inter;
  font-style: normal;
  font-weight: 400 600;
  font-display: swap;
  src: url("./fonts/inter-latin.woff2") format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+2000-206F, U+2122, U+2191, U+2193, U+2212, U+2215;
}

:root {
  /* Бумага и чернила */
  --bg: #f4eee2;
  --panel: #fdfbf6;
  --panel-strong: #ffffff;
  --ink: #22201c;
  --muted: #7a7164; /* светлее нельзя: контраст на тёплом фоне */
  --line: #cdbb9b;
  --kraft: #ede0c6;

  /* Бренд приглушён: прежний #1f4c43 бил слишком ярко на кнопках и заголовках.
     Проверено на контраст в обе стороны — белым по нему и им по бежевому. */
  --brand: #4f7370;
  --brand-2: #5a8380;
  --brand-soft: #dfeae4;

  /* Статус */
  --green: #2e6b5e;
  --green-soft: #cfe0d9;
  --amber: #b0842f;
  --amber-soft: #f0e2c2;
  --danger: #b23a2e;
  --danger-soft: #f2ddd9;
  --coral: #a2503a;
  --coral-soft: #e8d3cb;
  --blue: #44637e;
  --blue-soft: #d5dee6;
  --violet: #7a5568;
  --sand: #edc98f;
  --gray-soft: #e7ded0;

  /* Тени мятного тона и плотнее прежних. */
  --shadow: 0 10px 22px rgba(58, 92, 84, 0.26);

  /* Хром и металл: плоская краска вместо серого градиента */
  --active-button-gradient: #4f7370;
  --active-button-shadow: 0 4px 12px rgba(58, 92, 84, 0.28);

  /* Контуры иконок у неактивных кнопок — мятные. */
  --nav-icon: #5f9d8a;

  --app-gradient: linear-gradient(180deg, #f7f2e8 0%, #f4eee2 100%);
}

/* Фон приложения был зашит белым в обход палитры — отсюда и белизна.
   Белый стоял в трёх местах: body, оболочка поездки и экран главной. */
body,
.app-shell,
.home-screen,
.ideas-screen {
  background: var(--bg);
}

/* Inter во всех текстах. */
body,
button,
input,
select,
textarea,
.item-card,
.trip-list-card {
  font-family: Inter, "Segoe UI", Roboto, system-ui, sans-serif;
}

/* Заголовки — Inter полужирный. */
h1,
h2,
h3,
h4,
.section-heading,
#tripTitle,
.trip-list-card strong,
.day-card > h3,
.home-brand h1 {
  font-family: Inter, "Segoe UI", Roboto, system-ui, sans-serif;
  font-weight: 600;
}

/* Толщина картона, а уже под ней тень: торец светлее лицевой стороны,
   поэтому это две сплошные линии, а не размытие. Тень мятная — тем же
   тоном, каким её отбрасывает вверх блок кнопок внизу. */
.home-card,
.trip-list-card,
.day-card,
.item-card,
.stat-card,
.metric-card,
.trainer-card {
  box-shadow:
    0 2px 0 #e7dcc7,
    0 3px 2px rgba(58, 92, 84, 0.16),
    0 10px 22px rgba(58, 92, 84, 0.26);
}

/* Тренажёр — обычная карточка: своя рамка, градиент, внутренняя подсветка
   и жёсткая тень со смещением делали из него коробку внутри коробки.
   Тень остаётся, но общая, а не собственная. */
.home-trainer-shell {
  padding: 0;
  border: 0;
  background: none;
  box-shadow: none;
}

/* Кнопка «Скрыть тренажер» позиционируется от оболочки, а её внутренний
   отступ снят — без пересчёта смещений кнопка уезжала за край карточки.
   Значения повторяют собственный отступ карточки, поэтому кнопка встаёт
   в один ряд с «4 дня» и «45 000 ₽». */
.home-trainer-hide {
  right: 12px;
  bottom: 12px;
}

/* Старая карта на фоне главной: фрагмент со Средиземноморьем, приглушён
   до шёпота, чтобы не спорить с текстом. Лежит ниже содержимого и не ловит
   касания. Только на главной — остальные экраны остаются чистыми. */
.home-screen {
  position: relative;
}

/* position: fixed, а не background-attachment: fixed — второй игнорируется
   на iOS, и карта поехала бы вместе с содержимым. */
.home-screen::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  opacity: 0.6;
  background-image: url("./assets/map-home.jpg");
  background-size: cover;
  background-position: center;
}

.home-screen > * {
  position: relative;
  z-index: 1;
}

/* Неактивные кнопки: контур иконки мятный. У свечных SVG это уже даёт
   --nav-icon, а «свинка» — растровая картинка с фильтром invert, из-за
   которого она выходила белой. Красим её маской: цвет получается точный,
   а не подобранной цепочкой фильтров. */
/* Только копилка: класс .home-support-button носят все четыре кнопки ряда,
   и по классу маска ложилась поверх «i», «?» и самолётика. */
#donationPigButton {
  position: relative;
}

#donationPigButton img {
  visibility: hidden;
}

#donationPigButton::after {
  content: "";
  position: absolute;
  inset: 0;
  width: 30px;
  height: 30px;
  margin: auto;
  pointer-events: none;
  background-color: #5f9d8a;
  -webkit-mask: url("./icons/piggy-bank.png") center / contain no-repeat;
  mask: url("./icons/piggy-bank.png") center / contain no-repeat;
}

/* --- Цвета типов события: приглушённые тона вместо семи насыщенных --- */
.item-card {
  --item-card-bg: #fdfbf6;
  --item-card-accent: #6e675c;
  --item-slot-bg: rgba(205, 187, 155, 0.24);
  /* Опора для перфорации ниже: до этого паса у карточки не было position. */
  position: relative;
}

/* Призрак перетаскивания — это cloneNode карточки, поэтому каждое правило
   .item-card ложится и на него. Правило выше той же силы, но стоит в файле
   позже .drag-ghost, и position: fixed проигрывал по порядку: клон вставал
   в поток документа далеко ниже экрана. Палец тащил невидимку, на экране
   оставалась только подсветка дорожки дня — карточка не поднималась.
   Селектор из двух классов возвращает призраку его собственные свойства
   и делает это независимо от порядка правил, поэтому следующий пас по
   карточке события ничего здесь не уронит.
   Перфорация при этом не страдает: position: fixed тоже создаёт систему
   координат для абсолютных потомков. */
.item-card.drag-ghost {
  position: fixed;
  z-index: 50;
  opacity: 0.92;
  pointer-events: none;
  box-shadow: 0 18px 45px rgba(18, 54, 61, 0.28);
  /* Призрак — клон карточки, а карточка после паса по картону несёт
     перфорацию градиентом и многослойную тень. Без этого браузер
     перерисовывал бы всё это на каждом движении пальца; так он выносит
     призрак на отдельный слой и только сдвигает готовый кадр. */
  will-change: transform;
}

/* Пока лента принимает карточку, приглашение «Пока пусто» лишнее: место
   уже занято предпросмотром. */
.drop-target-active .empty-state {
  display: none;
}

/* След карточки в её родном дне. Держит ровно её габарит, поэтому день не
   схлопывается, когда карточка уезжает в соседний, и ничего ниже не
   подпрыгивает под пальцем. Габарит наследуется от .item-card — клон
   мелкий, поэтому размеры совпадают точно и переживут их правку. */
.item-card.drag-origin-slot {
  background: none;
  border: 1px dashed var(--a-line, rgba(28, 26, 23, 0.18));
  box-shadow: none;
  pointer-events: none;
}

.item-card.drag-origin-slot::before {
  content: none;
}

/* Перфорация по стыку шапки и тела карточки: отверстия пробиты цветом
   тела, поэтому читаются как высечка, а не как накладная полоска.
   44px — высота шапки из сетки самой карточки. */
.item-card::before {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  top: 44px;
  height: 14px;
  z-index: 2;
  transform: translateY(-50%);
  pointer-events: none;
  background-image:
    radial-gradient(circle 5.1px at 50% 50%, var(--item-card-bg) 0 5.1px, transparent 5.5px);
  background-size: 16px 14px;
  background-repeat: repeat-x;
}

/* Иконка и подпись типа занимают отдельные колонки. Раньше крупная
   выровненная вправо подпись обрезалась слева и выглядела так, будто
   начинается под иконкой. Фиксированная колонка и явный зазор сохраняют
   весь label в одну строку, не меняя размер карточки или иконки. */
.item-card .tile-icon {
  grid-template-columns: 34px minmax(0, 1fr);
  gap: 8px;
  padding: 4px 10px;
}

.item-card .tile-icon > span:first-child {
  width: 34px;
  min-width: 34px;
}

.item-card .tile-icon small {
  justify-content: flex-start;
  overflow: visible;
  font-size: 17px;
  letter-spacing: 0;
  line-height: 1;
  text-align: left;
  text-overflow: clip;
  white-space: nowrap;
}

/* Лёгкая фактура картона на шапке: продольное волокно и поперечный
   оттиск. Цвет остаётся акцентом типа, меняется только поверхность.
   Селектор с двумя классами — правила `.type-* .tile-icon` специфичнее
   одиночного и сбрасывают картинку шорткатом `background`. */
.item-card .tile-icon {
  background-color: var(--item-card-accent);
  background-image:
    repeating-linear-gradient(90deg, rgba(255, 255, 255, 0.06) 0 1px, transparent 1px 3px),
    repeating-linear-gradient(0deg, rgba(0, 0, 0, 0.05) 0 1px, transparent 1px 4px);
}

.type-transport {
  --item-card-accent: #44637e;
  --item-card-bg: #f6f5f2;
  --item-slot-bg: rgba(68, 99, 126, 0.12);
}

.type-stay {
  --item-card-accent: #8a6d2e;
  --item-card-bg: #f9f6ee;
  --item-slot-bg: rgba(138, 109, 46, 0.13);
}

.type-food {
  --item-card-accent: #a2503a;
  --item-card-bg: #f9f4f1;
  --item-slot-bg: rgba(162, 80, 58, 0.12);
}

.type-excursion {
  --item-card-accent: #2e6b5e;
  --item-card-bg: #f3f7f4;
  --item-slot-bg: rgba(46, 107, 94, 0.12);
}

.type-place {
  --item-card-accent: #6e675c;
  --item-card-bg: #f7f6f2;
  --item-slot-bg: rgba(110, 103, 92, 0.13);
}

.type-ticket {
  --item-card-accent: #44637e;
  --item-card-bg: #f5f7f8;
  --item-slot-bg: rgba(68, 99, 126, 0.12);
}

.type-spa {
  --item-card-accent: #7a5568;
  --item-card-bg: #f8f4f6;
  --item-slot-bg: rgba(122, 85, 104, 0.12);
}

.type-shopping {
  --item-card-accent: #2e6b5e;
  --item-card-bg: #f4f7f5;
  --item-slot-bg: rgba(46, 107, 94, 0.12);
}

.type-idea,
.type-other {
  --item-card-accent: #6e675c;
  --item-card-bg: #f7f6f2;
  --item-slot-bg: rgba(110, 103, 92, 0.13);
}

/* Чип статуса остаётся в цвете шапки своей карточки. */

/* ============================================================
   ГЛАВНАЯ И ОСТАЛЬНЫЕ ЭКРАНЫ · композиция
   Вычитание вместо украшения: содержимое человека идёт первым,
   одно первичное действие на экран, утилиты тише контента, шкала
   кеглей вместо одного размера. Карта — среда, а не текстура.

   ГРАНИЦА БЕЗОПАСНОСТИ. Перетаскивание карточек держится на zoom,
   display, position, cursor, touch-action и user-select у .item-card,
   а лента дня — на display: flex, overflow-x и touch-action у
   .day-items. Ни одно из этих свойств здесь не переопределяется.
   ============================================================ */

.home-screen {
  --a-ink: #1c1a17;
  --a-ink-soft: #6f675c;
  --a-line: rgba(28, 26, 23, 0.1);
  --a-paper: #f6f1e7;
  --a-card: #fffdf9;
  --a-brand: #2f5d55;
  --a-gap: 14px;
  /* Обработка любой фотографии на экране — одно место на весь макет.
     Тренажёр собирает её слоями фона, обложки поездок — фильтром;
     значения подобраны так, чтобы результат совпадал. */
  --a-photo-tone: #82653a;
  /* Тон тренажёра отдельным токеном: снимок обрабатывается тем же приёмом,
     что и обложки поездок, но фирменным зелёным — это единственное, чем
     тренажёр отличается от настоящей карточки, и различие держится на
     цвете, а не на геометрии. При blend-mode: color от тона берутся тон и
     насыщенность, светлота остаётся от фотографии. */
  --a-trainer-tone: #2f5d55;
  --a-photo-veil-top: rgba(246, 241, 231, 0.72);
  --a-photo-veil-bottom: rgba(246, 241, 231, 0.8);
  --a-photo-filter: sepia(0.45) saturate(0.78) contrast(1.04) brightness(1.06);
  background: var(--a-paper);
}

/* Карта остаётся средой, но гаснет там, где идёт текст: маска держит её
   плотной сверху за шапкой и снизу вокруг утилит и растворяет в полосе
   контента. Так «Идеи» и подпись ленты перестают лежать на изображении,
   и при этом не понадобилось ни одного нового контейнера. */
.home-screen::before {
  opacity: 0.4;
  -webkit-mask-image: linear-gradient(180deg, #000 0%, rgba(0, 0, 0, 0.18) 26%, rgba(0, 0, 0, 0.18) 74%, #000 100%);
  mask-image: linear-gradient(180deg, #000 0%, rgba(0, 0, 0, 0.18) 26%, rgba(0, 0, 0, 0.18) 74%, #000 100%);
}

/* ---------- Шапка: одна строка вместо блока в 97px ----------
   Плашку внизу рисует не контейнер, а .home-support-menu внутри него:
   градиент, рамка, радиус и тройная тень. Здесь повторены те же
   значения, только тень направлена вниз — обе постоянные полосы экрана
   должны быть одной вещью, а не двумя похожими. */
.home-screen .home-header {
  position: relative;
  z-index: 2;
  align-items: center;
  margin: 6px 16px 4px;
  padding: 8px 10px;
  border: 1px solid rgba(18, 54, 61, 0.12);
  border-radius: 8px;
  background:
    linear-gradient(#f7f2e8 0%, #f4eee2 100%),
    #fdfbf6;
  box-shadow:
    0 10px 24px rgba(18, 54, 61, 0.16),
    inset 0 1px 0 rgba(255, 255, 255, 0.86),
    inset 0 10px 18px rgba(18, 54, 61, 0.05);
}

/* Логотип отбивается от названия на собственную ширину: знак и текст —
   две разные сущности, а не одна слипшаяся строка. */
.home-screen .home-brand {
  gap: 42px;
}

.home-screen .home-brand img {
  width: 42px;
  height: 42px;
  margin: 0;
  filter: none;
}

/* Слово BACKPACKER перестаёт быть заголовком экрана: заголовок здесь —
   поездка. Марка остаётся, но размером с подпись. */
.home-screen .home-brand h1 {
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0.16em;
  color: var(--a-ink-soft);
  margin: 0;
}

.home-screen .home-profile-card {
  min-height: 0;
  padding: 0;
  border: 0;
  background: none;
  box-shadow: none;
}

.home-screen .home-profile-card strong {
  font-size: 17px;
  font-weight: 600;
  color: var(--a-ink);
}

/* Утилита в шапке — тихая иконка, а не залитая кнопка. */
.home-screen .home-share-button {
  width: 36px;
  min-width: 36px;
  height: 36px;
  min-height: 36px;
  padding: 0;
  border: 0;
  background: none;
  color: var(--a-ink-soft);
  box-shadow: none;
}

/* ---------- Композиция: содержимое человека идёт первым ---------- */
.home-screen .home-content {
  display: grid;
  gap: var(--a-gap);
  padding: 4px 16px 24px;
}

.home-screen .trip-list-section {
  order: 1;
  margin-top: 0;
}
.home-screen .received-trips-section { order: 2; }
.home-screen #openIdeasButton { order: 3; }
.home-screen .home-trainer-shell,
.home-screen #showTrainerButton { order: 4; }
.home-screen .ios-install-card { order: 5; }
.home-screen .sync-conflict-card { order: -1; }
/* Ряд утилит лежит внутри той же сетки: без явного порядка он вставал
   первым и оставлял пустую полосу под шапкой. */
.home-screen .home-support { order: 7; }
/* Первичное действие липкое — всегда под рукой, не листается. */
.home-screen #createTripButton { order: 6; }

/* ---------- Лента: заголовок снят, контент говорит сам ---------- */
.home-screen .home-list-heading {
  margin: 0 0 2px;
}

.home-screen .home-list-heading h2 {
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--a-ink-soft);
}

.home-screen .trip-list {
  display: grid;
  gap: 10px;
}

/* ---------- Герой: первая поездка крупно ---------- */
.home-screen .trip-list-card {
  position: relative;
  border: 1px solid var(--a-line);
  border-radius: 18px;
  background: var(--a-card);
  box-shadow: 0 1px 2px rgba(28, 26, 23, 0.04);
  overflow: hidden;
}

/* Карта живёт на фоне экрана, на карточке её нет: карта поверх карты
   съедала бы и то и другое. Карточка — чистый лист поверх среды. */

.home-screen .trip-card-open {
  display: grid;
  gap: 8px;
  padding: 18px 16px 16px;
  border: 0;
  background: none;
  box-shadow: none;
  text-align: left;
}

.home-screen .trip-card-status-row {
  margin: 0;
}

.home-screen .home-card-kicker {
  padding: 0;
  border: 0;
  background: none;
  box-shadow: none;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--a-ink-soft);
}

/* Название поездки — главный объект экрана. Плашку снимаем, но перенос
   запрещаем: вторая строка раздувает карточку, а высота карточки здесь
   важнее полноты редкого длинного названия. Длинное режется многоточием.
   У тренажёра заголовок — h2, у настоящей карточки — strong: нужны оба. */
.home-screen .trip-card-title-block h2,
.home-screen .trip-card-title-block strong {
  display: block;
  margin: 0;
  padding: 0;
  border: 0;
  background: none;
  box-shadow: none;
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
  font-size: 26px;
  font-weight: 600;
  line-height: 1.2;
  letter-spacing: -0.02em;
  /* Зелёный бренда повторяется здесь, чтобы цвет главной кнопки перестал
     выглядеть случайным: он держит и заголовок, и первичное действие. */
  color: var(--a-brand);
}

/* Направление и даты — сведения, а не ярлыки: снимаем плашки.
   Строка держится в одну: список городов вроде «Санкт-Петербург, Нижний
   Новгород, Москва» переносился и раздувал карточку, а высота карточки
   в ленте меняться не должна. Направление ужимается многоточием, даты
   остаются целыми — они короткие и по ним ищут глазами. */
.home-screen .trip-card-submeta {
  display: flex;
  flex-wrap: nowrap;
  align-items: baseline;
  gap: 4px 10px;
  margin-top: 2px;
}

.home-screen .trip-card-submeta > * {
  min-width: 0;
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
  padding: 0;
  border: 0;
  background: none;
  box-shadow: none;
  font-size: 14px;
  font-weight: 400;
  color: var(--a-ink-soft);
}

/* Даты не ужимаются: место уступает направление. */
.home-screen .trip-card-submeta > *:last-child {
  flex: 0 0 auto;
}

.home-screen .home-card-meta {
  display: flex;
  flex-wrap: nowrap;
  width: 100%;
  min-width: 0;
  gap: 4px 14px;
  margin-top: 6px;
  padding-top: 10px;
  border-top: 1px solid var(--a-line);
}

.home-screen .home-card-meta > * {
  padding: 0;
  border: 0;
  background: none;
  box-shadow: none;
  font-size: 13px;
  font-weight: 500;
  color: var(--a-ink-soft);
}

/* Дни и бюджет — одна общая строка во всех карточках поездки: тренажёре,
   личной и полученной. Дни забирают свободное место, сумма не сжимается
   и поэтому не может перейти на вторую строку. */
.home-screen .home-card-meta > *:first-child {
  flex: 1 1 auto;
  min-width: 0;
}

.home-screen .home-card-meta > *:last-child {
  flex: 0 0 auto;
  white-space: nowrap;
}

/* ---------- Обложки поездок: та же обработка, что у тренажёра ----------
   Фильтр на карточке красил и текст: filter действует на всё содержимое
   элемента, поэтому надписи выцветали вместе со снимком. Обработка ушла
   в слои фона — ровно как на тренажёре. Разметка отдаёт только адрес
   снимка в --trip-cover, вуаль и тон собираются здесь, поэтому тёмный
   текст читается на любой фотографии. */
.home-screen .trip-list-card[style*="--trip-cover"] {
  background-color: var(--a-card);
  background-image:
    linear-gradient(var(--a-photo-veil-top), var(--a-photo-veil-bottom)),
    linear-gradient(var(--a-photo-tone), var(--a-photo-tone)),
    var(--trip-cover);
  background-blend-mode: normal, color, normal;
  background-size: cover, cover, cover;
  background-position: center, center, center;
}

/* ---------- Иконки: один цвет и одна оболочка ----------
   У всех svg в разметке зашит белый stroke, поэтому цвет кнопки на них
   не действовал — на светлой бумаге иконки просто исчезали. Переводим
   на currentColor и красим тем же коричневым, что и текст. */
.home-screen .home-support-button svg,
.home-screen .home-share-button svg,
.home-screen .cover-trip-button svg,
.home-screen .ideas-entry-icon svg {
  stroke: currentColor;
}

/* Знак «поделиться» собран из линий и кружков: линии рисуются обводкой,
   кружки — заливкой. Красим оба свойства, иначе половина знака пропадает
   на светлой бумаге. Обводка вдвое тоньше исходной: при заливке кружков
   прежняя толщина утолщала знак и он выбивался из ряда. */
.home-screen .home-share-button svg,
.home-screen .home-share-button svg * {
  fill: currentColor;
  stroke: currentColor;
  stroke-width: 0.9;
}

/* Копилка — единственная неактивная кнопка в ряду, и по цвету она должна
   это показывать: контур светлее остальных иконок, но темнее бумаги. */
.home-screen #donationPigButton::after {
  background-color: #c2b6a0;
}

/* Единая оболочка вспомогательных иконок: круг без тени. */
.home-screen .cover-trip-button,
.home-screen .ideas-entry-icon {
  width: 34px;
  min-width: 34px;
  height: 34px;
  min-height: 34px;
  padding: 0;
  border: 0;
  border-radius: 999px;
  background: rgba(28, 26, 23, 0.06);
  color: var(--a-ink-soft);
  box-shadow: none;
}

.home-screen .cover-trip-button {
  top: 14px;
  right: 14px;
}

/* Удаление не должно быть самым громким элементом карточки. */
.home-screen .delete-trip-button {
  min-height: 0;
  padding: 4px 2px;
  border: 0;
  background: none;
  color: var(--a-ink-soft);
  box-shadow: none;
  font-size: 13px;
  font-weight: 500;
  text-decoration: underline;
  text-underline-offset: 3px;
}

/* ---------- «Идеи» перестаёт быть карточкой ---------- */
.home-screen #openIdeasButton {
  min-height: 0;
  padding: 12px 2px;
  border: 0;
  border-top: 1px solid var(--a-line);
  border-radius: 0;
  background: none;
  box-shadow: none;
  gap: 12px;
}

.home-screen #openIdeasButton::before {
  content: none;
}


.home-screen #openIdeasButton strong {
  font-size: 15px;
  font-weight: 600;
  color: var(--a-ink);
}

.home-screen #openIdeasButton span span,
.home-screen #openIdeasButton small {
  font-size: 13px;
  color: var(--a-ink-soft);
}

/* ---------- Тренажёр: полоса, а не вторая поездка ---------- */
.home-screen .home-trainer-shell {
  padding: 0;
  border: 0;
  background: none;
  box-shadow: none;
}

/* Тренажёр повторяет настоящую карточку один в один — иначе он учит не
   тому, что человек потом увидит. Отличие только в цвете: тише тон и
   надпись «Тренажер». Геометрия, кегли и отступы не трогаются. */
/* Те же радиус, отступы и кегли, что у настоящей карточки. Отличие одно:
   карточка не белая, а под цвет страницы, поэтому не спорит с реальными
   поездками. Казань лежит под ней монохромной сепией — фотография даёт
   узнаваемость, но не тянет на себя внимание.
   Сепия собрана слоями: сплошной тон смешивается со снимком в режиме
   color (остаётся только светлота), сверху бумажная вуаль для текста. */
/* У настоящей карточки содержимое лежит внутри button.trip-card-open с
   отступом 18/16/16, у тренажёра такой обёртки нет — строки шли прямо в
   карточке и прижимались к краю. Повторяем ту же внутреннюю сетку. */
.home-screen .trainer-card {
  min-height: 0;
  display: grid;
  gap: 8px;
  padding: 18px 16px 16px;
  border: 1px solid var(--a-line);
  border-radius: 18px;
  box-shadow: none;
  background-color: var(--a-paper);
  /* Тренажёр тонируется фирменным зелёным, а не сепией: обработка та же,
     что у обложек поездок, и различает их только оттенок. Иначе тренажёр
     неотличим от настоящей поездки, а он не поездка. */
  background-image:
    linear-gradient(var(--a-photo-veil-top), var(--a-photo-veil-bottom)),
    linear-gradient(var(--a-trainer-tone), var(--a-trainer-tone)),
    url("./assets/kazan-cover.jpg");
  background-blend-mode: normal, color, normal;
  background-size: cover, cover, cover;
  background-position: center, center, center;
}

/* Оболочка тренажёра несла отрицательные поля и делала карточку шире
   остальных на 12px — отступы от краёв экрана должны совпадать. */
.home-screen .home-trainer-shell {
  margin: 0;
  padding: 0;
}

.home-screen .trainer-card .trip-card-title-block h2,
.home-screen .trainer-card .trip-card-title-block strong {
  color: var(--a-ink-soft);
}

/* Ссылка возвращается на карточку, а не висит отдельной строкой над ней. */
.home-screen .home-trainer-shell {
  position: relative;
}

/* Ссылка встаёт туда же, где на настоящей карточке кнопка обложки. */
.home-screen .home-trainer-hide {
  position: absolute;
  top: 20px;
  right: 16px;
  bottom: auto;
  z-index: 3;
  min-height: 0;
  padding: 2px;
  border: 0;
  background: none;
  color: var(--a-ink-soft);
  box-shadow: none;
  font-size: 12px;
  font-weight: 500;
  text-decoration: underline;
  text-underline-offset: 3px;
}

/* ---------- Первичное действие: липкое, одно на экран ---------- */
.home-screen #createTripButton {
  position: sticky;
  bottom: 12px;
  z-index: 4;
  min-height: 54px;
  padding: 0 18px;
  border: 0;
  border-radius: 14px;
  background: var(--a-brand);
  color: #fff;
  box-shadow: 0 8px 20px rgba(28, 26, 23, 0.18);
  gap: 12px;
  align-items: center;
}

.home-screen #createTripButton::before {
  content: none;
}

.home-screen .cover-icon {
  width: 26px;
  min-width: 26px;
  height: 26px;
  border: 0;
  background: none;
  color: #fff;
}

.home-screen #createTripButton strong {
  font-size: 16px;
  font-weight: 600;
  color: #fff;
}

/* Подпись «Добавить обложку поездки» — служебная, на кнопке лишняя. */
.home-screen #createTripButton span span,
.home-screen #createTripButton small {
  display: none;
}

/* ---------- Нижние утилиты: тихий ряд ---------- */
.home-screen .home-support {
  padding: 4px 16px calc(8px + env(safe-area-inset-bottom));
  border: 0;
  border-top: 1px solid var(--a-line);
  background: none;
}

/* Иконки здесь — не svg, а текстовые знаки «i» и «?», картинка копилки и
   обводка самолётика. Каждый красился белым своим правилом, поэтому на
   светлой бумаге ряд просто исчезал. Сводим всё к одному коричневому. */
.home-screen .home-support-button,
.home-screen .home-support-button span,
.home-screen .home-support-button svg {
  color: var(--a-ink-soft);
}

.home-screen .home-support-button {
  min-height: 40px;
  border: 0;
  background: none;
  box-shadow: none;
}

.home-screen .home-support-button svg {
  stroke: currentColor;
}

.app-shell,
.ideas-screen {
  --a-ink: #1c1a17;
  --a-ink-soft: #6f675c;
  --a-line: rgba(28, 26, 23, 0.1);
  --a-paper: #f6f1e7;
  --a-card: #fffdf9;
  --a-brand: #2f5d55;
}

/* ---------- Шапка поездки: 216px под то, что не меняется ---------- */
.app-shell .trip-header {
  padding: 8px 16px 12px;
  background: none;
  box-shadow: none;
}

.app-shell #tripTitle {
  font-size: 24px;
  font-weight: 600;
  line-height: 1.16;
  letter-spacing: -0.02em;
  color: var(--a-brand);
}

.app-shell .trip-meta {
  padding: 0;
  border: 0;
  background: none;
  box-shadow: none;
  font-size: 13px;
  font-weight: 400;
  color: var(--a-ink-soft);
}

/* Бюджет — сведение, а не кнопка-таблетка. */
.app-shell .trip-budget-meta {
  min-height: 0;
  padding: 0;
  border: 0;
  background: none;
  box-shadow: none;
  font-size: 13px;
  font-weight: 500;
  color: var(--a-ink-soft);
}

.app-shell .trip-summary-row {
  justify-content: flex-start;
}

.app-shell .share-role-banner.hidden + .trip-budget-meta {
  grid-column: 1 / -1;
}

/* ---------- Полоса бюджета: три числа, а не три коробки ----------
   Оплачено / Бронь / Свободно — это одна мысль в трёх долях. Заливки,
   рамки и тени превращали её в три равных объекта и забирали 70px. */
.app-shell .budget-strip {
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0;
  margin-top: 10px;
  padding-block: 10px;
  border-top: 1px solid var(--a-line);
}

.app-shell .budget-strip > div {
  width: 100%;
  min-width: 0;
  min-height: 0;
}

.app-shell .budget-strip .paid-card,
.app-shell .budget-strip .budget-allocation-card {
  padding: 0 8px;
  border: 0;
  border-radius: 0;
  background: none;
  box-shadow: none;
}

.app-shell .budget-strip .budget-allocation-card + .budget-allocation-card,
.app-shell .budget-strip .paid-card + .budget-allocation-card {
  border-left: 1px solid var(--a-line);
}

.app-shell .budget-strip .paid-card {
  padding-left: 8px;
}

.app-shell .budget-strip span {
  display: flex;
  align-items: center;
  min-height: 15px;
  font-size: clamp(9px, 2.8vw, 11px);
  font-weight: 500;
  line-height: 1.15;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  white-space: nowrap;
  color: var(--a-ink-soft);
}

.app-shell .budget-strip .paid-card span::before {
  flex: 0 0 15px;
}

.app-shell .budget-strip strong {
  min-width: 0;
  font-size: clamp(15px, 4.3vw, 17px);
  font-weight: 600;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
  color: var(--a-ink);
}

/* ---------- Подписи разделов ---------- */
.app-shell .section-heading h2,
.app-shell .section-heading h3 {
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--a-ink-soft);
}

/* ---------- День: рамка вместо коробки ---------- */
.app-shell .day-card {
  border: 1px solid var(--a-line);
  border-radius: 16px;
  background: var(--a-card);
  box-shadow: 0 1px 2px rgba(28, 26, 23, 0.04);
}

.app-shell .day-card > h3,
.app-shell .day-title {
  font-size: 19px;
  font-weight: 600;
  letter-spacing: -0.01em;
  color: var(--a-ink);
}

.app-shell .day-total {
  font-size: 17px;
  font-weight: 600;
  color: var(--a-brand);
}

/* ---------- Утилиты шапки: как на главной ---------- */
.app-shell .header-actions .icon-button,
.app-shell .header-actions .telegram-icon-button {
  width: 36px;
  min-width: 36px;
  height: 36px;
  min-height: 36px;
  padding: 0;
  border: 0;
  background: none;
  color: var(--a-ink-soft);
  box-shadow: none;
}

.app-shell .header-actions .icon-button svg,
.app-shell .header-actions .telegram-icon-button svg {
  stroke: currentColor;
}

.app-shell .header-actions .share-icon-button svg,
.app-shell .header-actions .share-icon-button svg * {
  fill: currentColor;
  stroke: currentColor;
  stroke-width: 0.9;
}

/* Кнопка возврата остаётся залитой: это единственная навигация назад. */
.app-shell .brand-home-button {
  background: var(--a-brand);
  border-color: rgba(28, 26, 23, 0.14);
}

/* ---------- Нижняя навигация ---------- */
.app-shell .nav-button svg {
  stroke: currentColor;
}

.app-shell .nav-button {
  color: var(--a-ink-soft);
}

.app-shell .nav-button.active {
  background: var(--a-brand);
  border-color: rgba(28, 26, 23, 0.14);
  color: #fff;
}

/* ---------- Экран идей: те же правила ---------- */
.ideas-screen .ideas-back-button {
  background: var(--a-brand);
  border-color: rgba(28, 26, 23, 0.14);
}

.ideas-screen .section-heading h2,
.ideas-screen .section-heading h3 {
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--a-ink-soft);
}

.ideas-screen .idea-card {
  border: 1px solid var(--a-line);
  border-radius: 14px;
  background: var(--a-card);
  box-shadow: 0 1px 2px rgba(28, 26, 23, 0.04);
}

/* ============================================================
   СПЛЭШ И ОНБОРДИНГ
   Первое, что человек видит, жило по старым правилам: белый фон,
   марка весом 900 в бирюзовом, стеклянная кнопка и восемь плиток в
   насыщенных цветах. Плитки — это типы событий, поэтому они получают
   ровно те же приглушённые тона, что и корешки карточек: онбординг
   начинает обещать тот интерфейс, который человек потом увидит.
   ============================================================ */

.app-splash,
.intro-screen {
  background: #f6f1e7;
}

/* Карта под сплэшем — та же, что на главной, и по той же рецептуре: экран
   запуска обещает ту бумагу, на которую человек через секунду попадёт.
   Слой абсолютный, поэтому не становится ячейкой грида и не сдвигает
   логотип из центра; плитки типов лежат поверх, они позиционированы. */
.app-splash::before {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  opacity: 0.4;
  background-image: url("./assets/map-home.jpg");
  background-size: cover;
  background-position: center;
  -webkit-mask-image: linear-gradient(180deg, #000 0%, rgba(0, 0, 0, 0.18) 26%, rgba(0, 0, 0, 0.18) 74%, #000 100%);
  mask-image: linear-gradient(180deg, #000 0%, rgba(0, 0, 0, 0.18) 26%, rgba(0, 0, 0, 0.18) 74%, #000 100%);
}

.app-splash-card h1,
.intro-card .intro-title-brand {
  font-weight: 600;
  letter-spacing: 0.04em;
  color: #2f5d55;
}

.app-splash-card p {
  font-weight: 400;
  color: #6f675c;
}

.intro-card h1 {
  font-weight: 600;
  letter-spacing: -0.02em;
  color: #1c1a17;
}

.intro-card p {
  font-weight: 400;
  color: #6f675c;
}

/* Кнопка перестаёт быть стеклянной: плоская краска бренда. */
.intro-button {
  border: 0;
  border-radius: 14px;
  background: #2f5d55;
  color: #fff;
  box-shadow: 0 8px 20px rgba(28, 26, 23, 0.18);
  font-size: 17px;
  font-weight: 600;
}

/* Плитки типов — та же палитра, что у корешков карточек события. */
.splash-ticket,
.floater-ticket {
  background: #44637e;
}

.splash-food,
.floater-food {
  background: #a2503a;
}

.splash-place,
.floater-place {
  background: #6e675c;
}

.splash-spa,
.floater-spa {
  background: #7a5568;
}

.splash-excursion,
.floater-excursion {
  background: #2e6b5e;
}

.floater-stay {
  background: #8a6d2e;
}

.floater-idea {
  background: #6e675c;
}

.floater-shopping {
  background: #2e6b5e;
}

/* Плитки теряют тиснение: одна мягкая тень вместо жёсткого смещения. */
.splash-tile,
.intro-floater {
  border-radius: 12px;
  box-shadow: 0 4px 12px rgba(28, 26, 23, 0.1);
}

/* Логотип без жёсткой тени со смещением. */
.app-splash-card img,
.intro-logo {
  filter: none;
}

/* Марка, логотип и текст стояли в верхней трети, а между абзацем и
   кнопкой висел провал в 123px: третья строка сетки — 250px, абзац
   занимал 141 и прижимался к её верху. Группа опускается, абзац
   центрируется в своей строке — пустота распределяется поровну. */
.intro-card {
  align-content: start;
  padding-top: 58px;
}

.intro-card p {
  align-self: center;
}

/* ============================================================
   ЭКРАН БЮДЖЕТА
   Все плашки были залиты зелёным бренда — пять одинаково громких
   блоков подряд, и глазу не за что зацепиться. Числа умеют говорить
   сами: бумага, тихая подпись, крупная цифра. Зелёный остаётся один
   на экран — на «Свободно», единственном числе, ради которого сюда
   заходят.
   ============================================================ */

.app-shell .budget-metric-group h3 {
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--a-ink-soft);
}

.app-shell .metric-card {
  border: 1px solid var(--a-line);
  border-radius: 14px;
  background: var(--a-card);
  color: var(--a-ink);
  box-shadow: none;
}

.app-shell .metric-card span {
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--a-ink-soft);
}

.app-shell .metric-card strong {
  font-size: 20px;
  font-weight: 600;
  color: var(--a-ink);
}

/* Единственное число, ради которого открывают этот экран. */
.app-shell .metric-card.budget-limit-total {
  border-color: transparent;
  background: var(--a-brand);
}

.app-shell .metric-card.budget-limit-total span {
  color: rgba(255, 255, 255, 0.72);
}

.app-shell .metric-card.budget-limit-total strong {
  color: #fff;
}

/* ============================================================
   ЭКРАН ИДЕЙ
   Чипы подборок были залиты все одинаково, поэтому выбранная не
   отличалась от остальных. Активная остаётся краской, прочие —
   тихой обводкой.
   ============================================================ */

.ideas-screen .idea-collection-chip {
  border: 1px solid var(--a-line);
  background: none;
  color: var(--a-ink);
  box-shadow: none;
  font-weight: 500;
}

.ideas-screen .idea-collection-chip.active,
.ideas-screen .idea-collection-chip[aria-pressed="true"],
.ideas-screen .idea-collection-chip[aria-selected="true"] {
  border-color: transparent;
  background: var(--a-brand);
  color: #fff;
}

/* ============================================================
   ШТОРКИ
   Тень была почти чёрной и с большим смещением — панель выглядела
   тяжелее содержимого. Один мягкий слой того же мятного тона.
   ============================================================ */

.sheet-panel {
  box-shadow: 0 -10px 30px rgba(58, 92, 84, 0.18);
}

.sheet-header h2,
.sheet-header h3 {
  font-size: 19px;
  font-weight: 600;
  letter-spacing: -0.01em;
  color: var(--a-ink, #1c1a17);
}

/* ============================================================
   ЕДИНЫЙ ЗЕЛЁНЫЙ
   На экранах жили два: канонический #2f5d55 с главной и продакшновый
   #4f7370. Второй остался на кнопке добавления, плашке результата и
   двух кнопках калькулятора — цвет бренда не может быть «примерно
   таким». Всё сводится к одному.
   ============================================================ */

.app-shell .fab,
.app-shell [class*="fab"],
.app-shell .currency-result,
.app-shell #refreshRatesButton,
.app-shell .currency-swap-button {
  background: var(--a-brand);
  border-color: rgba(28, 26, 23, 0.14);
}

/* ============================================================
   ИКОНКИ ШАПКИ
   Шестерёнка рисуется псевдоэлементом с белым цветом, у самолётика
   заливка задана на самих путях — поэтому цвет с кнопки до них не
   доходил и на светлой бумаге они пропадали.
   ============================================================ */

.app-shell .header-actions .icon-button::before,
.app-shell .header-actions .icon-button::after {
  color: var(--a-ink-soft);
  -webkit-text-stroke-color: currentColor;
}

.app-shell .header-actions svg,
.app-shell .header-actions svg * {
  fill: currentColor;
  stroke: currentColor;
  stroke-width: 0.9;
}

/* Карта на экране поездки снята: фоновый слой во весь экран — единственное,
   что этот пас добавил к структуре, а перетаскивание карточек объявлено
   неприкосновенным. Возвращаем исходное устройство экрана; цвет и
   типографика остаются. */

/* ============================================================
   МАРКЕР УЧАСТНИКА
   Ярко-рыжий кружок остался от первой версии и был самым громким
   пятном на экране — громче статуса и цены. Приводим к плотности
   чипов статуса: те же приглушённые тона, что у корешков.
   ============================================================ */

.participant-orange {
  background: #a2503a;
}

.participant-blue {
  background: #44637e;
}

.participant-teal {
  background: #2e6b5e;
}

.participant-pink {
  background: #7a5568;
}

/* ============================================================
   КАРТОЧКА СОБЫТИЯ: торец убран
   Толщина картона появилась в общем пасе по токенам, но на карточке
   события спорит с корешком и перфорацией — двух приёмов на один
   объект достаточно. Остаётся только тень.
   ГЕОМЕТРИЯ И МЕХАНИКА ПЕРЕТАСКИВАНИЯ НЕ ЗАТРОНУТЫ.
   ============================================================ */

.app-shell .item-card {
  box-shadow: 0 6px 16px rgba(58, 92, 84, 0.18);
}

/* Логотип онбординга опускается ещё ниже. */
.intro-card {
  padding-top: 96px;
}

/* Шестерёнка нарисована псевдоэлементом с жёстко заданным белым и
   селектором по id — селектор по классам его не перебивал. */
#editTripButton::before {
  color: var(--a-ink-soft, #6f675c);
  font-size: 24px;
}

/* Все кнопки приложения берут цвет из --active-button-gradient. Точечные
   переопределения оставляли #4f7370 в шторках, смете и черновике —
   поэтому меняется сам токен, один раз на весь эксперимент. */
.app-shell,
.ideas-screen,
.sheet {
  --active-button-gradient: #2f5d55;
}

/* Буква внутри чипа участника — белая: на приглушённой заливке тёмная
   сливалась с фоном кружка. */
.participant-avatar {
  color: #fff;
}

/* ============================================================
   НИЖНЯЯ НАВИГАЦИЯ — ОДНА ПЛАНКА
   Внутри поездки это были четыре отдельные кнопки со своими рамками и
   тенями, а на главной — единая планка. Одна и та же роль на экране не
   может выглядеть двумя разными способами. Значения повторяют
   .home-support-menu ровно.
   ============================================================ */

.app-shell .bottom-nav {
  padding: 6px 8px;
  border: 1px solid rgba(18, 54, 61, 0.12);
  border-radius: 8px;
  background:
    linear-gradient(#f7f2e8 0%, #f4eee2 100%),
    #fdfbf6;
  box-shadow:
    0 -10px 24px rgba(18, 54, 61, 0.16),
    inset 0 1px 0 rgba(255, 255, 255, 0.86),
    inset 0 -10px 18px rgba(18, 54, 61, 0.05);
}

/* Кнопки внутри планки — без собственных границ и теней. */
.app-shell .bottom-nav .nav-button {
  border: 0;
  background: none;
  box-shadow: none;
}

.app-shell .bottom-nav .nav-button.active {
  border: 0;
  background: var(--a-brand);
  box-shadow: none;
}

/* Логотип онбординга центрируется между маркой и текстом: строка сетки
   равна его высоте, поэтому свободное место копилось только снизу —
   22 сверху против 66 снизу. Сдвиг выравнивает оба зазора. */
.intro-logo {
  transform: translateY(32px);
}
