/* =========================================================================
   Сад ⇄ Сад — design system (Gosuslugi-inspired, responsive)
   ========================================================================= */
:root {
  --blue:        #0d4cd3;
  --blue-600:    #0a3cb0;
  --blue-700:    #082f8c;
  --blue-050:    #eef3ff;
  --blue-100:    #dbe6ff;
  --red:         #ee3f58;
  --green:       #17a54a;
  --green-050:   #e6f7ec;
  --amber:       #f0a020;
  --amber-050:   #fff4e0;

  --ink:         #21232c;
  --ink-2:       #444a54;
  --muted:       #6b7280;
  --muted-2:     #9aa1ac;
  --line:        #e6eaf0;
  --line-2:      #eef1f6;
  --bg:          #f4f6fa;
  --card:        #ffffff;

  --radius:      20px;
  --radius-sm:   12px;
  --radius-btn:  10px;
  --shadow:      0 2px 8px rgba(20, 37, 82, .06), 0 1px 2px rgba(20, 37, 82, .04);
  --shadow-lg:   0 12px 34px rgba(20, 37, 82, .12);
  --ring:        0 0 0 3px rgba(13, 76, 211, .22);

  --container:   1120px;
  --font: "Segoe UI", -apple-system, BlinkMacSystemFont, "Golos Text", Roboto,
          "Helvetica Neue", Arial, sans-serif;
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  font-family: var(--font);
  color: var(--ink);
  background: var(--bg);
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  /* push the footer to the bottom when the content is short */
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}
.app-main { flex: 1 0 auto; }
h1, h2, h3, h4 { margin: 0 0 .4em; line-height: 1.2; font-weight: 700; letter-spacing: -.01em; }
h1 { font-size: clamp(1.6rem, 1.1rem + 2vw, 2.4rem); }
h2 { font-size: clamp(1.25rem, 1rem + 1vw, 1.6rem); }
p  { margin: 0 0 1rem; }
a  { color: var(--blue); text-decoration: none; }
a:hover { text-decoration: underline; }
img, svg { max-width: 100%; }

.container { width: 100%; max-width: var(--container); margin: 0 auto; padding: 0 20px; }

.skip-link {
  position: absolute; left: -999px; top: 0; background: var(--blue); color: #fff;
  padding: 10px 16px; border-radius: 0 0 8px 0; z-index: 100;
}
.skip-link:focus { left: 0; }

/* ---------- Header ---------- */
.app-header {
  background: var(--card);
  border-bottom: 1px solid var(--line);
  position: sticky; top: 0; z-index: 40;
}
.app-header__inner { display: flex; align-items: center; gap: 16px; min-height: 68px; }
.brand { display: flex; align-items: center; gap: 12px; color: inherit; flex-shrink: 0; }
.brand:hover { text-decoration: none; }
.brand__mark { display: inline-flex; flex-shrink: 0; }
.brand__text { display: flex; flex-direction: column; }
.brand__name { font-weight: 800; font-size: 1.15rem; letter-spacing: -.02em; }
.brand__swap { color: var(--blue); }
.brand__go { color: var(--blue); }
.brand__tag { font-size: .74rem; color: var(--muted); font-weight: 500; }
.app-header__right { margin-left: auto; display: flex; align-items: center; gap: 10px; min-width: 0; }

.loc-chip {
  display: inline-flex; align-items: center; gap: 6px;
  background: var(--blue-050); color: var(--blue-600);
  border: 1px solid var(--blue-100); border-radius: 999px;
  padding: 7px 14px; font-size: .85rem; font-weight: 600; cursor: pointer;
  max-width: 46vw; overflow: hidden; flex: 0 1 auto; min-width: 0;
}
.loc-chip[hidden] { display: none; }  /* the location chip stays hidden until a search sets it */
.loc-chip svg { flex-shrink: 0; }     /* keep the pin; only the text label truncates */
.loc-chip--located svg { color: var(--red); }  /* определённое (геолокация) местоположение — красный маркер */
.loc-chip span { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; min-width: 0; }
.loc-chip:hover { background: var(--blue-100); }
.icon-btn {
  width: 38px; height: 38px; border-radius: 50%; border: 1px solid var(--line); flex-shrink: 0;
  background: #fff; color: var(--blue); font-size: 1.1rem; font-weight: 700; cursor: pointer;
}
.icon-btn:hover { background: var(--blue-050); }

/* PWA install banner (mobile) */
.install-bar {
  display: flex; align-items: center; gap: 8px;
  background: var(--blue-050); border-bottom: 1px solid var(--blue-100);
  padding: 6px 16px;
}
.install-bar[hidden] { display: none; }
.install-bar__main {
  flex: 1; min-width: 0; display: inline-flex; align-items: center; gap: 10px;
  background: none; border: none; cursor: pointer; text-align: left;
  color: var(--blue-600); font: inherit; font-weight: 700; font-size: .95rem; padding: 6px 2px;
}
.install-bar__main svg { flex-shrink: 0; }
.install-bar__close {
  flex-shrink: 0; width: 34px; height: 34px; border-radius: 8px;
  border: none; background: transparent; color: var(--muted);
  font-size: 1.5rem; line-height: 1; cursor: pointer;
}
.install-bar__close:hover { background: rgba(0,0,0,.06); }


/* ---------- Buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  font: inherit; font-weight: 600; cursor: pointer; border: 1px solid transparent;
  border-radius: var(--radius-btn); padding: 13px 22px; line-height: 1;
  transition: background .15s, box-shadow .15s, border-color .15s, transform .05s;
  text-decoration: none; white-space: nowrap;
}
.btn:active { transform: translateY(1px); }
.btn:focus-visible { outline: none; box-shadow: var(--ring); }
.btn--primary { background: var(--blue); color: #fff; }
.btn--primary:hover { background: var(--blue-600); text-decoration: none; }
.btn--secondary { background: var(--blue-050); color: var(--blue-600); border-color: var(--blue-100); }
.btn--secondary:hover { background: var(--blue-100); text-decoration: none; }
.btn--ghost { background: transparent; color: var(--blue-600); border-color: var(--line); }
.btn--ghost:hover { background: var(--blue-050); text-decoration: none; }
.btn--lg { padding: 16px 30px; font-size: 1.05rem; border-radius: 12px; }
.btn--block { display: flex; width: 100%; }
.btn[disabled] { opacity: .55; cursor: not-allowed; }
.btn svg { flex: none; }

/* ---------- Cards / generic ---------- */
.card {
  background: var(--card); border: 1px solid var(--line); border-radius: var(--radius);
  box-shadow: var(--shadow); padding: 22px;
}
.muted { color: var(--muted); }
.small { font-size: .86rem; }
.stack > * + * { margin-top: 14px; }

/* ---------- Hero (start screen) ---------- */
.hero { padding: 20px 0 10px; }
.hero__grid { display: grid; grid-template-columns: 1.15fr .85fr; gap: 28px; align-items: center; }
.hero__eyebrow {
  display: inline-block; background: var(--blue-050); color: var(--blue-600);
  border: 1px solid var(--blue-100); border-radius: 999px; padding: 6px 14px;
  font-size: .82rem; font-weight: 700; margin-bottom: 16px;
}
.hero p.lead { font-size: 1.12rem; color: var(--ink-2); }
.hero__cta { display: flex; gap: 12px; flex-wrap: wrap; margin-top: 22px; }
.hero__note { margin-top: 14px; color: var(--muted); font-size: .85rem; }

.hero__art {
  background: linear-gradient(160deg, #0d4cd3 0%, #2f6bff 60%, #4f8bff 100%);
  border-radius: var(--radius); padding: 26px; color: #fff; box-shadow: var(--shadow-lg);
  position: relative; overflow: hidden;
}
.hero__art h3 { color: #fff; }
.swap-visual { display: grid; grid-template-columns: 1fr auto 1fr; gap: 12px; align-items: center; margin-top: 8px; }
.swap-visual__node { background: rgba(255,255,255,.14); border: 1px solid rgba(255,255,255,.25); border-radius: 14px; padding: 14px; text-align: center; }
.swap-visual__node b { display: block; font-size: 1.4rem; }
.swap-visual__arrow { font-size: 1.6rem; opacity: .9; }

.how { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; margin-top: 34px; }
.how__item { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius-sm); padding: 18px; }
.how__head { display: flex; align-items: center; gap: 10px; margin-bottom: 8px; }
.how__head h3 { margin: 0; font-size: 1.05rem; }
.how__num { width: 30px; height: 30px; border-radius: 50%; background: var(--blue-050); color: var(--blue-600); font-weight: 800; display: grid; place-items: center; flex: none; }

/* ---------- Activity feed (home) ---------- */
.feed { margin: 38px 0 8px; }
.feed h2 { margin-bottom: 4px; }
.feed__sub { margin: 0 0 16px; }
.feed-list { display: flex; flex-direction: column; gap: 12px; }
.feed-item__meta { color: var(--muted); font-size: .85rem; white-space: nowrap; }
.feed-status { text-align: center; padding: 16px 0; min-height: 20px; }

.feed-card { background: var(--card); border: 1px solid var(--line); border-left-width: 3px; border-radius: var(--radius-sm); box-shadow: var(--shadow); padding: 16px 18px; }
.feed-card--exchange { border-left-color: var(--blue); }
.feed-card--application { border-left-color: var(--amber); }
.feed-card__head { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin-bottom: 12px; }
.feed-card__title { font-weight: 700; font-size: 1rem; }
.feed-card__head .feed-item__meta { margin-left: auto; }

/* exchange chain (anonymised, like the deal card) */
.feed-x__chain { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 8px; }
.feed-x__part { display: flex; align-items: center; gap: 10px 12px; flex-wrap: wrap; }
.feed-x__who { font-size: .78rem; font-weight: 700; color: var(--muted); min-width: 92px; }
.feed-x__move { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }

/* application */
.feed-a__row { margin: 5px 0; font-size: .95rem; }
.feed-a__label { color: var(--muted); font-weight: 600; }
.feed-a__desired { margin: 4px 0 0; padding-left: 20px; }
.feed-a__desired li { margin: 3px 0; }
.feed-g__city { color: var(--muted); font-weight: 400; }

/* ---------- Toolbar (results) ---------- */
.toolbar {
  display: flex; align-items: center; gap: 16px; flex-wrap: wrap;
  background: var(--card); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 16px 18px; box-shadow: var(--shadow); margin: 10px 0 18px;
}
.toolbar__loc { display: flex; align-items: center; gap: 10px; font-weight: 600; }
.toolbar__loc svg { color: var(--blue); }
.radius { display: flex; align-items: center; gap: 12px; flex: 1; min-width: 240px; }
.radius input[type=range] { flex: 1; accent-color: var(--blue); }
.radius__val { font-weight: 700; color: var(--blue-600); min-width: 62px; text-align: right; }

.segmented { display: inline-flex; background: var(--line-2); border-radius: 999px; padding: 4px; gap: 4px; }
.segmented button {
  border: none; background: transparent; font: inherit; font-weight: 600; color: var(--muted);
  padding: 8px 16px; border-radius: 999px; cursor: pointer; display: inline-flex; align-items: center; gap: 6px;
}
.segmented button.is-active { background: #fff; color: var(--blue-600); box-shadow: var(--shadow); }

/* location editor / manual address */
.toolbar__loc { flex-wrap: wrap; }
.loc-text { max-width: 46ch; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.loc-edit { background: none; border: none; color: var(--blue-600); font: inherit; font-weight: 600; cursor: pointer; padding: 2px 6px; border-radius: 6px; }
.loc-edit:hover { background: var(--blue-050); text-decoration: underline; }
.addr-search { flex-basis: 100%; width: 100%; display: flex; flex-direction: column; gap: 12px; margin-top: 6px; padding-top: 14px; border-top: 1px solid var(--line-2); }
.addr-search .autocomplete { max-width: 560px; }
.addr-presets { display: flex; flex-direction: column; gap: 6px; }
.addr-presets__chips { display: flex; flex-wrap: wrap; align-content: flex-start; gap: 8px; max-height: 132px; overflow-y: auto; padding: 2px 6px 2px 0; }
.city-chip { background: var(--blue-050); border: 1px solid var(--blue-100); color: var(--blue-600); border-radius: 999px; padding: 6px 14px; font: inherit; font-weight: 600; font-size: .85rem; cursor: pointer; }
.city-chip:hover { background: var(--blue-100); }
.kind-badge { text-transform: lowercase; }
.addr-search .btn--ghost { align-self: flex-start; }
.linklike { background: none; border: none; color: var(--blue-600); font: inherit; font-weight: 600; cursor: pointer; padding: 0; text-decoration: underline; }
.linklike:hover { color: var(--blue-700); }
.hero__manual { margin: 12px 0 0; }

.notice {
  display: flex; gap: 10px; align-items: flex-start; background: var(--amber-050);
  border: 1px solid #f4d9a6; color: #8a5a12; border-radius: var(--radius-sm);
  padding: 12px 14px; font-size: .9rem; margin-bottom: 16px;
}
.notice--info { background: var(--blue-050); border-color: var(--blue-100); color: var(--blue-700); }
.notice b { font-weight: 700; }

/* ---------- Results list ---------- */
.results-head { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; margin: 4px 2px 12px; flex-wrap: wrap; }
.results-head .hint { color: var(--muted); font-size: .9rem; }

.garden-list { display: flex; flex-direction: column; gap: 12px; }
.garden {
  display: grid; grid-template-columns: 1fr auto; gap: 16px; align-items: center;
  background: var(--card); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 16px 18px; box-shadow: var(--shadow); transition: border-color .15s, box-shadow .15s;
}
.garden:hover { border-color: var(--blue-100); box-shadow: var(--shadow-lg); }
.garden__rank {
  display: flex; flex-direction: column; align-items: center; gap: 4px;
}
.garden__rank-num {
  width: 34px; height: 34px; border-radius: 10px; background: var(--blue); color: #fff;
  font-weight: 800; display: grid; place-items: center; font-size: 1rem;
}
.rank-btn {
  width: 26px; height: 22px; border: 1px solid var(--line); background: #fff; border-radius: 6px;
  cursor: pointer; color: var(--muted); display: grid; place-items: center; padding: 0;
}
.rank-btn:hover:not([disabled]) { background: var(--blue-050); color: var(--blue-600); border-color: var(--blue-100); }
.rank-btn[disabled] { opacity: .35; cursor: default; }

.garden__body { min-width: 0; }
.garden__name { font-weight: 700; font-size: 1.04rem; margin-bottom: 3px; }
.garden__meta { color: var(--muted); font-size: .88rem; display: flex; flex-wrap: wrap; gap: 4px 14px; }
.garden__meta .num { color: var(--blue-600); font-weight: 600; }
.garden__addr { color: var(--ink-2); font-size: .9rem; margin-top: 4px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.garden__side { display: flex; flex-direction: column; align-items: flex-end; gap: 8px; }
.giveup {
  display: inline-flex; align-items: center; gap: 7px; border-radius: 999px;
  padding: 7px 12px; font-weight: 700; font-size: .86rem; white-space: nowrap;
}
.giveup--has { background: var(--green-050); color: #0f7a37; border: 1px solid #bfe8cd; }
.giveup--none { background: var(--line-2); color: var(--muted); border: 1px solid var(--line); }
.giveup b { font-size: 1rem; }
.map-link { background: none; border: none; color: var(--blue-600); font: inherit; font-weight: 600; cursor: pointer; display: inline-flex; align-items: center; gap: 5px; padding: 2px; }
.map-link:hover { text-decoration: underline; }

.dist-pill { font-size: .8rem; color: var(--muted); font-weight: 600; }

/* priority add / restore control */
button.garden__rank-num { border: none; cursor: pointer; font-family: inherit; }
button.garden__rank-num:hover { background: var(--blue-600); }
.rank-add {
  width: 34px; height: 34px; border-radius: 10px; border: 1.5px dashed var(--blue-100);
  background: var(--blue-050); color: var(--blue-600); font-size: 1.15rem; font-weight: 700;
  cursor: pointer; display: grid; place-items: center; line-height: 1;
}
.rank-add:hover { background: var(--blue-100); border-color: var(--blue); }
.row-actions { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; justify-content: flex-end; }
.row-action { background: none; border: none; font: inherit; font-weight: 600; cursor: pointer; color: var(--muted); padding: 2px; }
.row-action:hover { text-decoration: underline; color: var(--ink-2); }
.row-action--danger { color: var(--red); }
.row-action--danger:hover { color: var(--red); }
.garden--excluded { opacity: .6; }
.garden--excluded:hover { opacity: .85; }
.excluded-head { margin: 22px 2px 10px; font-weight: 700; color: var(--muted); font-size: .92rem; }
.garden__rank--muted { color: var(--muted-2); font-size: 1.1rem; display: grid; place-items: center; }

/* iOS-style toggle (в заявке / исключён) */
.switch { position: relative; display: inline-flex; align-items: center; gap: 8px; cursor: pointer; user-select: none; }
.switch__label { font-size: .82rem; font-weight: 600; color: var(--muted); min-width: 62px; text-align: right; }
.switch input { position: absolute; opacity: 0; width: 1px; height: 1px; margin: 0; }
.switch__track {
  position: relative; width: 46px; height: 27px; border-radius: 999px; flex: none;
  background: #d7dbe0; transition: background .22s ease;
}
.switch__thumb {
  position: absolute; top: 2.5px; left: 2.5px; width: 22px; height: 22px; border-radius: 50%;
  background: #fff; box-shadow: 0 1px 3px rgba(0, 0, 0, .28), 0 1px 1px rgba(0, 0, 0, .16);
  transition: transform .22s ease;
}
.switch input:checked + .switch__track { background: #34c759; }
.switch input:checked + .switch__track .switch__thumb { transform: translateX(19px); }
.switch input:focus-visible + .switch__track { box-shadow: 0 0 0 3px rgba(52, 199, 89, .35); }

/* map priority hint */
.map-hint {
  display: flex; align-items: center; gap: 8px 10px; flex-wrap: wrap;
  background: var(--blue-050); border: 1px solid var(--blue-100); color: var(--blue-700);
  border-radius: var(--radius-sm); padding: 10px 14px; margin-bottom: 12px; font-size: .9rem;
}
.mh-dot { display: inline-block; width: 11px; height: 11px; border-radius: 50%; vertical-align: -1px; }
.mh-green { background: var(--green); }
.mh-gray { background: var(--muted-2); }

/* action bar */
.actionbar {
  position: sticky; bottom: 0; z-index: 20; margin-top: 18px;
  background: linear-gradient(to top, var(--bg) 62%, rgba(244,246,250,0));
  padding: 14px 0 18px;
}
.actionbar__inner {
  display: flex; align-items: center; gap: 14px; justify-content: space-between;
  background: var(--card); border: 1px solid var(--line); border-radius: var(--radius);
  box-shadow: var(--shadow-lg); padding: 14px 18px; flex-wrap: wrap;
}
.actionbar__summary { font-size: .92rem; color: var(--ink-2); }
.actionbar__summary b { color: var(--ink); }

/* ---------- Schematic / real map ---------- */
.map-wrap { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); overflow: hidden; }
#realmap { width: 100%; height: min(62vh, 560px); }
.schematic { width: 100%; display: block; background:
  radial-gradient(circle at 50% 50%, #ffffff 0%, #f2f6ff 70%, #e9f0ff 100%); }
.schematic-legend { display: flex; gap: 16px; flex-wrap: wrap; padding: 12px 18px; border-top: 1px solid var(--line); font-size: .85rem; color: var(--muted); }
.legend-dot { display: inline-block; width: 12px; height: 12px; border-radius: 50%; margin-right: 6px; vertical-align: -1px; }

/* ---------- Forms ---------- */
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; }
.field { display: flex; flex-direction: column; gap: 6px; }
.field--full { grid-column: 1 / -1; }
.field label { font-weight: 600; font-size: .92rem; }
.field .req { color: var(--red); }
.field .help { color: var(--muted); font-size: .82rem; }
.input, .select, textarea.input {
  font: inherit; padding: 12px 14px; border: 1.5px solid var(--line); border-radius: var(--radius-btn);
  background: #fff; color: var(--ink); width: 100%; transition: border-color .15s, box-shadow .15s;
}
.input:focus, .select:focus, textarea.input:focus { outline: none; border-color: var(--blue); box-shadow: var(--ring); }
.input.is-error { border-color: var(--red); }
.field__error { color: var(--red); font-size: .82rem; min-height: 0; }

.group-chip {
  display: inline-flex; align-items: center; gap: 8px; align-self: flex-start;
  background: var(--blue-050); border: 1px solid var(--blue-100); color: var(--blue-700);
  border-radius: 999px; padding: 8px 14px; font-weight: 700; font-size: .9rem;
}
.group-chip small { font-weight: 500; color: var(--blue-600); }
.group-chip.is-warn { background: var(--amber-050); border-color: #f4d9a6; color: #8a5a12; }

/* autocomplete */
.autocomplete { position: relative; }
.ac-list {
  position: absolute; z-index: 30; left: 0; right: 0; top: calc(100% + 6px);
  background: #fff; border: 1px solid var(--line); border-radius: var(--radius-sm);
  box-shadow: var(--shadow-lg); max-height: 320px; overflow: auto; padding: 6px;
}
.ac-item { padding: 10px 12px; border-radius: 8px; cursor: pointer; }
.ac-item:hover, .ac-item.is-active { background: var(--blue-050); }
.ac-item__name { font-weight: 600; }
.ac-item__name .num { color: var(--blue-600); }
.ac-item__addr { color: var(--muted); font-size: .82rem; }
.ac-empty { padding: 12px; color: var(--muted); font-size: .88rem; }

.chosen-garden {
  display: flex; align-items: flex-start; gap: 12px; background: var(--blue-050);
  border: 1px solid var(--blue-100); border-radius: var(--radius-sm); padding: 14px;
}
.chosen-garden .x { margin-left: auto; background: none; border: none; color: var(--muted); cursor: pointer; font-size: 1.2rem; }

.priority-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 8px; }
.priority-list li { display: flex; align-items: center; gap: 10px; background: #fff; border: 1px solid var(--line); border-radius: 10px; padding: 10px 12px; }
.priority-list .p-mark { width: 8px; height: 8px; border-radius: 50%; background: var(--green); flex: none; }
.priority-list .p-give { margin-left: auto; font-size: .82rem; color: #0f7a37; font-weight: 700; }
.priority-list .p-give--none { color: var(--muted); }
.priority-list .pg__name { flex: 1; min-width: 0; }
.priority-list .pg--excluded { opacity: .6; }
@media (max-width: 620px) { .priority-list .p-give { display: none; } }

/* ---------- Confirmation ---------- */
.done { text-align: center; max-width: 640px; margin: 10px auto; }
.done__check { width: 84px; height: 84px; border-radius: 50%; background: var(--green-050); color: var(--green); display: grid; place-items: center; margin: 0 auto 18px; }
.summary { text-align: left; margin: 20px 0; }
.summary__row { display: flex; justify-content: space-between; gap: 16px; padding: 12px 0; border-bottom: 1px solid var(--line-2); }
.summary__row:last-child { border-bottom: none; }
.summary__row dt { color: var(--muted); }
.summary__row dd { margin: 0; font-weight: 600; text-align: right; }
.pin-callout { background: linear-gradient(160deg, var(--blue) 0%, #2f6bff 100%); color: #fff; border-radius: var(--radius); padding: 22px; margin: 18px 0; box-shadow: var(--shadow-lg); }
.pin-callout__label { font-weight: 700; font-size: .95rem; opacity: .95; margin-bottom: 12px; }
.pin-callout__code { display: flex; gap: 10px; justify-content: center; margin-bottom: 14px; }
.pin-box { width: 52px; height: 64px; border-radius: 12px; background: rgba(255,255,255,.16); border: 1px solid rgba(255,255,255,.42); display: grid; place-items: center; font-size: 2rem; font-weight: 800; font-variant-numeric: tabular-nums; }
.pin-callout__hint { font-size: .88rem; opacity: .96; line-height: 1.5; max-width: 470px; margin: 0 auto; }

.next-steps { text-align: left; background: var(--blue-050); border: 1px solid var(--blue-100); border-radius: var(--radius-sm); padding: 18px; }
.next-steps ol { margin: 8px 0 0; padding-left: 20px; }
.next-steps li { margin-bottom: 6px; }

/* ---------- States ---------- */
.center-state { text-align: center; padding: 48px 20px; }
.spinner { width: 46px; height: 46px; border: 4px solid var(--blue-100); border-top-color: var(--blue); border-radius: 50%; margin: 0 auto 18px; animation: spin 1s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.skeleton { background: linear-gradient(90deg, #eef1f6 25%, #f6f8fc 37%, #eef1f6 63%); background-size: 400% 100%; animation: sh 1.4s ease infinite; border-radius: 8px; }
@keyframes sh { 0% { background-position: 100% 0 } 100% { background-position: 0 0 } }

/* ---------- Toast ---------- */
.toast {
  position: fixed; left: 50%; bottom: 24px; transform: translateX(-50%);
  background: var(--ink); color: #fff; padding: 12px 20px; border-radius: 12px;
  box-shadow: var(--shadow-lg); z-index: 90; font-weight: 600; max-width: 90vw;
}
.toast--error { background: var(--red); }
.toast--ok { background: var(--green); }

/* ---------- Footer ---------- */
.app-footer { background: var(--card); border-top: 1px solid var(--line); margin-top: 40px; padding: 26px 0; }
.app-footer__inner { display: grid; gap: 8px; font-size: .9rem; color: var(--ink-2); }
.app-footer__muted { color: var(--muted); font-size: .84rem; }

/* ---------- Modal (help) ---------- */
.modal-backdrop { position: fixed; inset: 0; background: rgba(15,23,42,.5); z-index: 80; display: grid; place-items: center; padding: 20px; }
.modal { background: #fff; border-radius: var(--radius); max-width: 560px; width: 100%; padding: 26px; box-shadow: var(--shadow-lg); max-height: 86vh; overflow: auto; }
.modal h2 { margin-top: 0; }
.modal__close { float: right; }

/* ---------- Header: «Мои заявки» ---------- */
.deals-chip {
  display: inline-flex; align-items: center; gap: 6px; flex-shrink: 0;
  background: #fff; color: var(--blue-600);
  border: 1px solid var(--line); border-radius: 999px;
  padding: 7px 14px; font: inherit; font-size: .85rem; font-weight: 600; cursor: pointer;
}
.deals-chip:hover { background: var(--blue-050); border-color: var(--blue-100); }
.deals-chip svg { color: var(--blue); }

/* ---------- My deals ---------- */
.deals-lookup { display: flex; gap: 10px; flex-wrap: wrap; }
.deals-lookup__contact { flex: 1 1 240px; min-width: 200px; }
.deals-lookup__pin { flex: 0 0 132px; width: 132px; text-align: center; font-weight: 700; font-size: 1.05rem; }
.deals-lookup .btn { flex: none; }
/* lookup fields (phone + e-mail + pin) in one row */
.lookup-grid { display: grid; grid-template-columns: 1fr 1fr 120px; gap: 12px; align-items: start; }
.lookup-grid .lookup-pin { text-align: center; font-weight: 700; letter-spacing: .12em; }

.deal { padding: 0; overflow: hidden; }
.deal + .deal { margin-top: 16px; }
.deal__head { padding: 18px 20px; border-bottom: 1px solid var(--line-2); background: var(--blue-050); }
.deal__title { font-weight: 800; font-size: 1.12rem; margin: 8px 0 2px; }

.deal-badge {
  display: inline-flex; align-items: center; gap: 6px; border-radius: 999px;
  padding: 5px 12px; font-size: .78rem; font-weight: 800; letter-spacing: .01em;
  text-transform: uppercase;
}
.deal-badge--wait { background: var(--amber-050); color: #8a5a12; border: 1px solid #f4d9a6; }
.deal-badge--ok   { background: var(--green-050); color: #0f7a37; border: 1px solid #bfe8cd; }
.deal-badge--off  { background: var(--line-2); color: var(--muted); border: 1px solid var(--line); }
.deal-badge--info { background: var(--blue-050); color: var(--blue-700); border: 1px solid var(--blue-100); }

/* application card (shown above the exchange, or above "no exchange yet") */
.appcard { margin-bottom: 16px; }
.appcard__head { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.appcard__kicker { font-size: .78rem; font-weight: 700; text-transform: uppercase; letter-spacing: .04em; color: var(--blue-600); }
.appcard__name { font-weight: 800; font-size: 1.2rem; margin-top: 2px; }
.appcard .summary { margin: 10px 0 0; }
.deal + .appcard, .no-deal + .appcard { margin-top: 22px; }
.no-deal { margin-top: 0; }

.deal-chain { list-style: none; margin: 0; padding: 6px 0; }
.deal-part { padding: 14px 20px; border-bottom: 1px solid var(--line-2); position: relative; }
.deal-part:last-child { border-bottom: none; }
.deal-part--you { background: #fbfdff; }
.deal-part--you::before { content: ""; position: absolute; left: 0; top: 0; bottom: 0; width: 3px; background: var(--blue); }
.deal-part__who { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.deal-part__name { font-weight: 700; }
.you-tag { background: var(--blue); color: #fff; border-radius: 6px; padding: 1px 8px; font-size: .72rem; font-weight: 800; }
.confirm-chip { margin-left: auto; border-radius: 999px; padding: 3px 10px; font-size: .78rem; font-weight: 700; }
.confirm--yes  { background: var(--green-050); color: #0f7a37; }
.confirm--no   { background: #fde8ec; color: var(--red); }
.confirm--wait { background: var(--line-2); color: var(--muted); }

.deal-part__move { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin-top: 8px; }
.deal-g { border-radius: 8px; padding: 5px 10px; font-size: .9rem; font-weight: 600; border: 1px solid var(--line); }
.deal-g--from { background: #fff; color: var(--ink-2); }
.deal-g--to { background: var(--blue-050); color: var(--blue-700); border-color: var(--blue-100); }
.deal-arrow { color: var(--blue); font-weight: 800; }
.deal-part__contacts { display: flex; gap: 8px 18px; flex-wrap: wrap; margin-top: 8px; font-size: .9rem; }
.deal-part__contacts a { font-weight: 600; }

.deal__note { padding: 12px 20px 0; }
.deal__video { padding: 0; }
.deal-video-link {
  display: block; padding: 14px 20px; text-align: center;
  background: var(--blue-050); border-top: 1px solid var(--line-2);
  color: var(--blue-600); font-weight: 700; text-decoration: none;
}
.deal-video-link:hover { background: var(--blue-100); }
.deal__actions { display: flex; gap: 10px; flex-wrap: wrap; padding: 14px 20px 20px; }
.deal-decline { color: var(--red); border-color: #f3c6ce; }
.deal-decline:hover { background: #fde8ec; }
.deal-confirm { display: flex; flex-direction: column; gap: 10px; width: 100%; background: #fde8ec; border: 1px solid #f3c6ce; border-radius: var(--radius-sm); padding: 14px 16px; }
.deal-confirm__q { color: #a01427; font-weight: 600; font-size: .92rem; }
.deal-confirm__btns { display: flex; gap: 10px; flex-wrap: wrap; }
.deal__banner { margin: 0; padding: 16px 20px; font-weight: 600; font-size: .94rem; }
.deal__banner--wait { background: var(--amber-050); color: #8a5a12; }
.deal__banner--ok { background: var(--green-050); color: #0f7a37; }

/* participant chat (between a chat and comments) */
.deal-chat { border-top: 1px solid var(--line); padding: 16px 20px 20px; background: #fbfdff; }
.deal-chat__head { font-weight: 700; font-size: .92rem; color: var(--ink-2); margin-bottom: 12px; }
.deal-chat__list { display: flex; flex-direction: column; gap: 10px; max-height: 300px; overflow-y: auto; padding-right: 4px; margin-bottom: 12px; }
.chat-empty { color: var(--muted); font-size: .9rem; padding: 6px 0; }
.chat-msg { background: #fff; border: 1px solid var(--line); border-radius: 14px; padding: 8px 12px; max-width: 86%; align-self: flex-start; }
.chat-msg--you { background: var(--blue-050); border-color: var(--blue-100); align-self: flex-end; }
.chat-msg__meta { font-size: .74rem; margin-bottom: 2px; display: flex; gap: 8px; align-items: baseline; }
.chat-msg__author { font-weight: 700; color: var(--ink-2); }
.chat-msg__time { color: var(--muted-2); }
.chat-msg__text { font-size: .92rem; white-space: pre-wrap; overflow-wrap: anywhere; }
.deal-chat__form { display: flex; gap: 10px; flex-wrap: wrap; }
.deal-chat__form .chat-input { flex: 1 1 180px; }
.deal-chat__form .btn { flex: none; }

/* ---------- Responsive ---------- */
@media (max-width: 900px) {
  .hero__grid { grid-template-columns: 1fr; }
  .hero__art { order: -1; }
  .how { grid-template-columns: 1fr; }
  .form-grid { grid-template-columns: 1fr; }
}
@media (max-width: 620px) {
  .brand__tag { display: none; }
  .brand__mark { display: none; }   /* mobile: keep the "KinderGo" wordmark, drop the icon */
  .deals-chip span { display: none; }
  .deals-chip { padding: 8px; }
  .app-header__inner { gap: 12px; }
  .app-header__right { gap: 8px; }
  .loc-chip { max-width: none; padding: 7px 12px; }
  .confirm-chip { margin-left: 0; }
  .deals-lookup .btn { width: 100%; }
  .deals-lookup__pin { flex: 1 1 100%; width: auto; }
  .lookup-grid { grid-template-columns: 1fr; }
  .pin-box { width: 44px; height: 56px; font-size: 1.6rem; }
  .garden { grid-template-columns: 1fr; }
  .garden__side { grid-column: 1 / -1; align-items: flex-start; gap: 10px; border-top: 1px dashed var(--line); padding-top: 12px; margin-top: 2px; }
  .garden__side .row-actions { width: 100%; }
  .toolbar { flex-direction: column; align-items: stretch; }
  .segmented { align-self: stretch; }
  .segmented button { flex: 1; justify-content: center; }
  .actionbar__inner { flex-direction: column; align-items: stretch; }
  .actionbar__inner .btn { width: 100%; }
}
@media (max-width: 400px) {
  .container { padding: 0 14px; }
}
