:root {
  --cream: #faf6f0;
  --cream-2: #f4ece2;
  --card: #ffffff;
  --ink: #14263f;
  --ink-2: #56687e;
  --ink-3: #8d9bab;
  --coral: #ff5a36;
  --coral-d: #e8431f;
  --coral-soft: #ffece6;
  --teal: #0e7c74;
  --teal-soft: #e2f2f0;
  --save: #17864a;
  --save-soft: #e2f3e8;
  --line: #ece2d6;
  --line-2: #f3ece4;
  --amber: #e8912b;
  --radius: 16px;
  --radius-sm: 11px;
  --shadow-s: 0 1px 2px rgba(20, 38, 63, .05), 0 4px 14px rgba(20, 38, 63, .05);
  --shadow-m: 0 2px 6px rgba(20, 38, 63, .06), 0 14px 34px rgba(20, 38, 63, .08);
  --font: "Segoe UI", "SF Pro Display", -apple-system, BlinkMacSystemFont, "Inter", "Helvetica Neue", Arial, sans-serif;
}

* { box-sizing: border-box; }

[hidden] { display: none !important; }

html, body { height: 100%; }

body {
  margin: 0;
  font-family: var(--font);
  color: var(--ink);
  background:
    radial-gradient(760px 380px at 88% -6%, rgba(255, 90, 54, .10), transparent 62%),
    radial-gradient(620px 340px at -4% 4%, rgba(14, 124, 116, .09), transparent 60%),
    var(--cream);
  background-attachment: fixed;
  -webkit-font-smoothing: antialiased;
  font-size: 15px;
  line-height: 1.45;
}

.svg-defs { position: absolute; width: 0; height: 0; overflow: hidden; }

.sr-only {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}

.app {
  max-width: 1240px;
  margin: 0 auto;
  padding: 14px 24px 48px;
}

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

/* ---------- masthead ---------- */

.masthead {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  padding: 2px 2px 12px;
}

.masthead__brand { display: flex; align-items: center; gap: 13px; }

.logo { display: block; line-height: 0; filter: drop-shadow(0 6px 14px rgba(255, 90, 54, .30)); }

.masthead__row { display: flex; align-items: center; gap: 9px; }

.brand {
  margin: 0;
  font-size: 25px;
  font-weight: 800;
  letter-spacing: -.035em;
  line-height: 1.05;
}

.tagline {
  margin: 3px 0 0;
  font-size: 13.5px;
  color: var(--ink-2);
  letter-spacing: -.005em;
}

/* ---------- buttons ---------- */

.btn {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, .82);
  color: var(--ink);
  font-size: 13.5px;
  font-weight: 650;
  padding: 8px 15px;
  cursor: pointer;
  transition: transform .16s ease, box-shadow .16s ease, background .16s ease, color .16s ease;
}

.btn:hover { background: #fff; box-shadow: var(--shadow-s); transform: translateY(-1px); }

.btn--link {
  border: 0;
  background: transparent;
  color: var(--teal);
  padding: 6px 4px;
  font-weight: 650;
}

.btn--link:hover { background: transparent; box-shadow: none; color: #0a5f59; }

.pin-btn {
  display: inline-grid;
  place-items: center;
  width: 34px;
  height: 34px;
  border-radius: 11px;
  border: 1px solid var(--line);
  background: #fff;
  color: var(--ink-2);
  cursor: pointer;
  transition: color .16s ease, border-color .16s ease, background .16s ease, transform .16s ease;
}

.pin-btn:hover { color: var(--teal); border-color: #bfdedb; background: var(--teal-soft); transform: translateY(-1px); }

.pin-btn--demo:hover { color: var(--coral-d); border-color: #ffcdbf; background: var(--coral-soft); }

/* ---------- studio (params + map as one tool) ---------- */

.studio {
  display: grid;
  grid-template-columns: 386px 1fr;
  gap: 0;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 22px;
  box-shadow: var(--shadow-m);
  overflow: hidden;
}

.studio__panel {
  padding: 14px;
  background: linear-gradient(180deg, #fffdfa 0%, #fdf8f2 100%);
  border-right: 1px solid var(--line-2);
  display: flex;
  flex-direction: column;
  gap: 8px;
}

/* address search line */

.searchline {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 7px 8px 7px 11px;
  border-radius: 14px;
  background: #fff;
  border: 1px solid var(--line);
  box-shadow: var(--shadow-s);
}

.searchline__pin {
  color: var(--teal);
  display: grid;
  place-items: center;
  margin-top: 3px;
}

.searchline__body { min-width: 0; flex: 1; }

.searchline__label {
  display: block;
  font-size: 13.5px;
  font-weight: 750;
  letter-spacing: -.015em;
  line-height: 1.25;
  color: var(--ink);
  text-wrap: pretty;
}

.searchline__hint {
  margin: 3px 0 0;
  font-size: 12px;
  font-weight: 500;
  line-height: 1.35;
  color: var(--ink-2);
  text-wrap: pretty;
}

.searchline__value {
  margin: 4px 0 0;
  font-size: 14px;
  font-weight: 650;
  letter-spacing: -.01em;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.searchline__actions { display: flex; gap: 6px; margin-top: 1px; }

.locator { display: flex; flex-direction: column; gap: 7px; }

.btn--wide {
  width: 100%;
  justify-content: center;
  border-color: #bfdedb;
  background: var(--teal-soft);
  color: #0a5f59;
}

.btn--wide:hover { background: #d7ece9; }

.btn--wide[disabled] { opacity: .6; cursor: progress; }

.addr { display: flex; gap: 6px; }

.addr__input {
  flex: 1;
  min-width: 0;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #fff;
  padding: 8px 12px;
  font-family: inherit;
  font-size: 13px;
  font-weight: 600;
  color: var(--ink);
}

.addr__input::placeholder { color: var(--ink-3); font-weight: 500; }

.addr__input:focus { outline: none; border-color: var(--teal); box-shadow: 0 0 0 3px rgba(14, 124, 116, .14); }

.btn--find { flex: none; border-radius: 12px; }

.locator__msg {
  margin: 0;
  padding: 6px 11px;
  border-radius: 10px;
  font-size: 12.5px;
  font-weight: 600;
  background: var(--cream-2);
  color: var(--ink-2);
  display: flex;
  align-items: center;
  gap: 8px;
}

.locator__msg--error { background: #fff2ee; color: #a3391c; }

.locator__msg--loading { background: var(--teal-soft); color: #0a5f59; }

/* tuner */

.tuner { display: flex; flex-direction: column; gap: 9px; }

.tuner__hint {
  margin: 4px 0 0;
  font-size: 12.5px;
  font-weight: 500;
  line-height: 1.35;
  color: var(--ink-2);
  text-wrap: pretty;
}

.app:not(.is-start) .tuner__hint { display: none; }

.tuner__row { display: flex; align-items: center; justify-content: space-between; gap: 10px; }

.tuner__label {
  font-size: 12.5px;
  font-weight: 650;
  color: var(--ink-2);
  white-space: nowrap;
}

.segmented {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  padding: 3px;
  background: var(--cream-2);
  border-radius: 12px;
}

.seg {
  border: 0;
  background: transparent;
  border-radius: 9px;
  padding: 5px 10px;
  font-size: 13px;
  font-weight: 700;
  color: var(--ink-2);
  cursor: pointer;
  transition: background .16s ease, color .16s ease, box-shadow .16s ease;
  white-space: nowrap;
}

.seg:hover { color: var(--ink); }

.seg.is-on {
  background: #fff;
  color: var(--ink);
  box-shadow: 0 1px 2px rgba(20, 38, 63, .10), 0 0 0 1px rgba(20, 38, 63, .04);
}

.segmented[data-target="servings"] .seg { min-width: 30px; }

.segmented[data-target="servings"] .seg.is-on { color: var(--coral-d); }

.seg__suffix { font-size: 11.5px; color: var(--ink-3); padding: 0 7px 0 3px; font-weight: 600; }

.segmented--soft .seg { padding: 5px 9px; font-size: 12.5px; }

/* budget */

.budget {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 8px 12px;
  border-radius: 14px;
  background: var(--coral-soft);
  border: 1px solid #ffdccf;
}

.budget__label { font-size: 12.5px; font-weight: 700; color: #a3391c; }

.budget__field {
  display: inline-flex;
  align-items: baseline;
  gap: 3px;
  background: #fff;
  border: 1px solid #ffd0c0;
  border-radius: 11px;
  padding: 4px 10px 4px 12px;
  transition: border-color .16s ease, box-shadow .16s ease;
}

.budget__field:focus-within { border-color: var(--coral); box-shadow: 0 0 0 3px rgba(255, 90, 54, .16); }

.budget__field input {
  width: 74px;
  border: 0;
  outline: none;
  background: transparent;
  font-size: 19px;
  font-weight: 800;
  letter-spacing: -.03em;
  color: var(--ink);
  text-align: right;
  -moz-appearance: textfield;
}

.budget__field input::-webkit-outer-spin-button,
.budget__field input::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }

.budget__cur { font-size: 15px; font-weight: 800; color: var(--coral-d); }

/* excludes */

.excludes { display: flex; flex-direction: column; gap: 7px; }

.excludes__head { display: flex; align-items: center; justify-content: space-between; gap: 10px; }

.excludes__picker select {
  appearance: none;
  border: 1px solid var(--line);
  background: #fff url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'><path d='M4 6l4 4 4-4' fill='none' stroke='%2356687e' stroke-width='1.7' stroke-linecap='round' stroke-linejoin='round'/></svg>") no-repeat right 8px center / 13px;
  border-radius: 10px;
  padding: 5px 26px 5px 11px;
  font-size: 12.5px;
  font-weight: 600;
  color: var(--ink-2);
  cursor: pointer;
  max-width: 170px;
}

.excludes__picker select:focus { outline: none; border-color: var(--teal); box-shadow: 0 0 0 3px rgba(14, 124, 116, .14); }

.chips { display: flex; flex-wrap: wrap; gap: 6px; }

.chips:empty::after {
  content: "Пока без ограничений";
  font-size: 12px;
  color: var(--ink-3);
}

.chip {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  border-radius: 999px;
  padding: 4px 6px 4px 11px;
  font-size: 12.5px;
  font-weight: 650;
}

.chip--exclude { background: var(--coral-soft); color: #a3391c; border: 1px solid #ffd6c8; }

.chip--exclude button {
  border: 0;
  background: rgba(255, 90, 54, .16);
  color: #a3391c;
  width: 17px;
  height: 17px;
  border-radius: 50%;
  line-height: 1;
  font-size: 12px;
  cursor: pointer;
  display: grid;
  place-items: center;
  padding: 0;
  transition: background .16s ease, color .16s ease;
}

.chip--exclude button:hover { background: var(--coral); color: #fff; }

/* CTA */

.cta {
  margin-top: auto;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 9px;
  width: 100%;
  border: 0;
  border-radius: 14px;
  padding: 12px 18px;
  font-size: 15.5px;
  font-weight: 750;
  letter-spacing: -.01em;
  color: #fff;
  background: linear-gradient(180deg, #ff6f4a 0%, var(--coral) 55%, var(--coral-d) 100%);
  box-shadow: 0 8px 20px rgba(255, 90, 54, .32);
  cursor: pointer;
  transition: transform .16s ease, box-shadow .16s ease, filter .16s ease;
}

.cta:hover:not(:disabled) { transform: translateY(-1px); box-shadow: 0 12px 26px rgba(255, 90, 54, .38); }

.cta:active { transform: translateY(0); }

.cta:disabled {
  filter: grayscale(.5) opacity(.55);
  cursor: not-allowed;
  transform: none;
  box-shadow: none;
}

.cta:disabled:hover { transform: none; box-shadow: none; }

.cta:disabled:hover svg { transform: none; }

.cta.is-busy:disabled {
  filter: grayscale(.35) opacity(.75);
  cursor: progress;
}

.cta svg { transition: transform .18s ease; }

.cta:hover:not(:disabled) svg { transform: translateX(3px); }

.fineprint {
  display: flex;
  align-items: center;
  gap: 6px;
  margin: 0;
  font-size: 11.5px;
  color: var(--ink-3);
}

.fineprint svg { flex: none; }

/* map side */

.studio__map { position: relative; display: flex; flex-direction: column; min-width: 0; background: #fff; }

.mapbar {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 9px 16px;
  font-size: 12.5px;
  font-weight: 650;
  color: var(--ink-2);
  border-bottom: 1px solid var(--line-2);
}

.mapbar__note {
  margin-left: auto;
  font-size: 11px;
  font-weight: 500;
  color: var(--ink-3);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.mapbar__dot {
  width: 8px; height: 8px; border-radius: 50%;
  background: var(--teal);
  box-shadow: 0 0 0 4px var(--teal-soft);
  flex: none;
}

.map { flex: 1; min-height: 322px; }

/* hero-иллюстрация стартового состояния */

.hero { display: none; }

.is-start .hero {
  display: block;
  position: relative;
  flex: none;
  height: 260px;
  margin: 0;
  background: var(--cream);
  animation: heroIn .5s cubic-bezier(.2, .7, .3, 1) both;
}

.hero img {
  position: absolute;
  inset: 0;
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
}

@keyframes heroIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

.is-start .mapbar,
.is-start .map { display: none; }

/* стартовое состояние на широких экранах: почти весь экран */

@media (min-width: 1200px) {
  .app.is-start {
    max-width: none;
    width: calc(100vw - 48px);
    padding: 14px 24px 48px;
  }

  .app.is-start .studio {
    grid-template-columns: 36% 1fr;
    height: calc(100vh - var(--head-h, 77px) - 48px);
    min-height: 620px;
  }

  /* карта живёт под иллюстрацией и успевает прогрузить тайлы к первому поиску */
  .app.is-start .hero {
    position: absolute;
    inset: 0;
    z-index: 1200; /* выше собственных слоёв Leaflet (панели 400, контролы 1000) */
    height: auto;
  }

  .app.is-start .mapbar { display: flex; }

  .app.is-start .map { display: block; }

  .app.is-start .studio__panel {
    padding: 22px;
    justify-content: center;
    gap: clamp(14px, 6vh, 70px);
  }

  .app.is-start .searchline { padding: 12px 11px 12px 14px; }

  .app.is-start .tuner { gap: clamp(11px, 3.6vh, 40px); }

  .app.is-start .seg { padding: 8px 13px; }

  .app.is-start .budget { padding: 13px 15px; }

  .app.is-start .cta { margin-top: 0; padding: 15px 18px; }
}

.app:not(.is-start) .tuner {
  gap: 7px;
}

.app:not(.is-start) .tuner__row {
  gap: 8px;
}

.leaflet-container { font-family: var(--font); background: #eef2f4; }

.leaflet-control-zoom a {
  border-radius: 9px !important;
  color: var(--ink) !important;
  border: 0 !important;
  box-shadow: var(--shadow-s);
}

.leaflet-control-attribution { font-size: 10px !important; background: rgba(255,255,255,.78) !important; }

/* ---------- results feed ---------- */

.feed { margin-top: 14px; }

.is-start .feed { display: none; }

/* real stores nearby */

.real {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 11px 13px 9px;
  box-shadow: var(--shadow-s);
  margin-bottom: 13px;
}

.real__head { display: flex; align-items: center; gap: 10px; margin-bottom: 4px; }

.real__title { margin: 0; font-size: 15px; font-weight: 750; letter-spacing: -.02em; }

.real__summary {
  margin: 2px 0 8px;
  font-size: 13.5px;
  line-height: 1.4;
  color: var(--ink);
  font-weight: 550;
}

.real__toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
  margin: 8px 0 6px;
}

.cta--feed {
  flex: 1 1 220px;
  margin: 0;
  padding: 12px 16px;
  font-size: 14.5px;
}

.real__list { display: flex; flex-direction: column; }

.real__group {
  margin: 8px 0 2px;
  padding: 0 6px;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: .04em;
  text-transform: uppercase;
  color: var(--ink-2);
}

.real__item {
  display: grid;
  grid-template-columns: 8px minmax(0, 1fr) auto;
  align-items: center;
  gap: 10px;
  padding: 6px 6px;
  border-radius: 10px;
  cursor: pointer;
}

.real__item:hover { background: var(--cream); }

.real__item.is-selected {
  background: var(--teal-soft);
  outline: 1px solid rgba(14, 124, 116, .22);
}

.real__dot { width: 8px; height: 8px; border-radius: 50%; background: var(--coral); flex: none; }
.real__dot--supported { background: var(--teal); }
.real__dot--ref { background: var(--coral); }

.real__legend {
  display: flex;
  flex-wrap: wrap;
  gap: 12px 18px;
  margin: 0 0 10px;
  padding: 0 2px;
  font-size: 12px;
  color: var(--ink-2);
}

.real__legend-item {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.real__name { margin: 0; font-size: 13.5px; font-weight: 650; letter-spacing: -.012em; }

.real__addr {
  margin: 1px 0 0;
  font-size: 12px;
  color: var(--ink-2);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.real__dist { font-size: 12.5px; font-weight: 700; color: var(--teal); white-space: nowrap; }

.real__side {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 4px;
}

.real__empty { margin: 2px 0 0; font-size: 13px; color: var(--ink-2); }

.real__toggle {
  flex: 0 0 auto;
  white-space: nowrap;
}

.real__list--collapsed {
  max-height: none;
}

.feedbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  flex-wrap: wrap;
  padding: 0 4px 10px;
}

.feedbar__stats { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }

.count {
  font-size: 25px;
  font-weight: 800;
  letter-spacing: -.04em;
  line-height: 1;
  color: var(--coral-d);
}

.count-word { font-size: 15px; font-weight: 750; letter-spacing: -.02em; margin-left: -2px; }

.feedbar__sep { width: 1px; height: 18px; background: var(--line); margin: 0 4px; }

.pill {
  font-size: 12px;
  font-weight: 650;
  color: var(--ink-2);
  background: rgba(255, 255, 255, .8);
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 4px 10px;
  white-space: nowrap;
}

.status {
  display: flex;
  align-items: center;
  gap: 10px;
  border-radius: 14px;
  padding: 13px 16px;
  font-size: 13.5px;
  font-weight: 600;
  margin-bottom: 12px;
  border: 1px solid var(--line);
  background: #fff;
  color: var(--ink-2);
}

.status--error { background: #fff2ee; border-color: #ffd2c4; color: #a3391c; }

.status--empty { background: #fffaf0; border-color: #f6e2bb; color: #8a5a10; }

.status--loading { background: var(--teal-soft); border-color: #c5e5e1; color: #0a5f59; }

.kr-spinner {
  width: 16px;
  height: 16px;
  border-radius: 50%;
  border: 2px solid rgba(14, 124, 116, .22);
  border-top-color: var(--teal);
  flex: none;
  animation: kr-spin .7s linear infinite;
}

.kr-spinner--on-btn {
  border-color: rgba(255, 255, 255, .35);
  border-top-color: #fff;
}

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

.btn.is-busy,
.cta.is-busy {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  cursor: progress;
}

.results-panel {
  position: relative;
}

.results-busy {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  margin: 0 0 12px;
  padding: 14px 16px;
  border-radius: 14px;
  border: 1px solid #c5e5e1;
  background: var(--teal-soft);
  color: #0a5f59;
  font-size: 13.5px;
  font-weight: 650;
}

.results-panel.is-initial-loading .results-busy {
  min-height: 72px;
}

.results-panel.is-refreshing .grid {
  opacity: .48;
  pointer-events: none;
  transition: opacity .18s ease;
}

.results-panel.is-refreshing .results-busy {
  position: sticky;
  top: calc(var(--head-h, 72px) + 8px);
  z-index: 2;
  box-shadow: var(--shadow-s);
}

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

/* ---------- dish card ---------- */

.dish {
  background:
    radial-gradient(210px 120px at 0% 0%, var(--tint, transparent), transparent 70%),
    var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 10px 13px 8px;
  box-shadow: var(--shadow-s);
  transition: transform .18s ease, box-shadow .18s ease, border-color .18s ease;
  animation: rise .34s cubic-bezier(.2, .7, .3, 1) both;
  animation-delay: calc(var(--i, 0) * 32ms);
}

@keyframes rise {
  from { opacity: 0; transform: translateY(9px); }
  to { opacity: 1; transform: none; }
}

.dish:hover { transform: translateY(-2px); box-shadow: var(--shadow-m); border-color: #e3d6c6; }

.dish--coral { --tint: rgba(240, 73, 42, .085); }
.dish--teal { --tint: rgba(15, 119, 111, .085); }
.dish--amber { --tint: rgba(232, 145, 43, .10); }
.dish--indigo { --tint: rgba(70, 87, 196, .085); }
.dish--plum { --tint: rgba(164, 70, 140, .085); }

.dish__head { display: grid; grid-template-columns: 44px 1fr auto; gap: 11px; align-items: start; }

.tile {
  width: 44px;
  height: 44px;
  border-radius: 13px;
  display: grid;
  place-items: center;
  overflow: hidden;
}

.tile svg { width: 38px; height: 38px; }

.tile--coral { background: linear-gradient(140deg, #ff8360, #f0492a); box-shadow: 0 5px 13px rgba(240, 73, 42, .28); }
.tile--teal { background: linear-gradient(140deg, #2fb3a3, #0f776f); box-shadow: 0 5px 13px rgba(15, 119, 111, .26); }
.tile--amber { background: linear-gradient(140deg, #ffc65c, #e8912b); box-shadow: 0 5px 13px rgba(232, 145, 43, .26); }
.tile--indigo { background: linear-gradient(140deg, #7e92f0, #4657c4); box-shadow: 0 5px 13px rgba(70, 87, 196, .24); }
.tile--plum { background: linear-gradient(140deg, #d98bc4, #a4468c); box-shadow: 0 5px 13px rgba(164, 70, 140, .24); }

.dish__ident { min-width: 0; padding-top: 1px; }

.dish__title {
  margin: 0;
  font-size: 16.5px;
  font-weight: 750;
  letter-spacing: -.024em;
  line-height: 1.2;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.dish__meta {
  margin: 5px 0 0;
  display: flex;
  flex-wrap: wrap;
  gap: 4px 10px;
  font-size: 12px;
  color: var(--ink-2);
}

.dish__meta span { display: inline-flex; align-items: center; gap: 4px; }

.dish__meta svg { color: var(--ink-3); flex: none; }

.dish__cost { text-align: right; white-space: nowrap; }

.dish__from {
  margin: 0;
  font-size: 21px;
  font-weight: 800;
  letter-spacing: -.04em;
  line-height: 1.05;
}

.dish__from-pre {
  font-size: 12px;
  font-weight: 650;
  color: var(--ink-3);
  letter-spacing: 0;
  margin-right: 4px;
}

.dish__per {
  margin: 3px 0 0;
  font-size: 12.5px;
  font-weight: 700;
  color: var(--coral-d);
}

/* store rows */

.dish__stores {
  margin-top: 8px;
  display: flex;
  flex-direction: column;
  gap: 1px;
}

.shop {
  display: grid;
  grid-template-columns: 8px minmax(0, 1fr) auto auto 62px;
  align-items: center;
  gap: 9px;
  width: 100%;
  text-align: left;
  border: 0;
  background: transparent;
  border-radius: 10px;
  padding: 5px 9px;
  cursor: pointer;
  transition: background .15s ease;
}

.shop:hover { background: var(--cream); }

.shop.is-active { background: var(--teal-soft); }

.shop__dot { width: 8px; height: 8px; border-radius: 50%; flex: none; }

.store-dot--svezhiy { background: var(--coral); }
.store-dot--domashniy { background: var(--teal); }
.store-dot--other { background: var(--amber); }

.shop__name {
  font-size: 13.5px;
  font-weight: 650;
  letter-spacing: -.012em;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.shop__branch { color: var(--ink-3); font-weight: 500; margin-left: 5px; }

.shop__walk {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 12px;
  color: var(--teal);
  font-weight: 650;
  white-space: nowrap;
}

.shop__price { font-size: 14px; font-weight: 750; letter-spacing: -.02em; white-space: nowrap; }

.shop__mark { display: flex; justify-content: flex-end; }

.mark {
  font-size: 10.5px;
  font-weight: 750;
  border-radius: 999px;
  padding: 2px 7px;
  white-space: nowrap;
}

.mark--cheap { background: var(--save-soft); color: var(--save); }

.mark--near { background: var(--teal-soft); color: var(--teal); }

.mark--catalog {
  background: color-mix(in srgb, var(--indigo, #4f46e5) 12%, white);
  color: var(--indigo, #4338ca);
  font-size: 0.72em;
}

.pill--catalog {
  background: color-mix(in srgb, var(--indigo, #4f46e5) 12%, white);
  color: var(--indigo, #4338ca);
}

.sources-pill {
  display: inline-flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 1px;
  max-width: min(100%, 22rem);
  padding: 5px 10px;
  line-height: 1.25;
  white-space: normal;
}

.sources-pill__title {
  font-size: 0.72em;
  font-weight: 750;
  letter-spacing: 0.01em;
}

.sources-pill__names {
  font-size: 0.82em;
  font-weight: 650;
}

.sources-pill__note {
  margin-top: 1px;
  font-size: 0.68em;
  font-weight: 500;
  opacity: 0.78;
  color: inherit;
}

.detail__catalog {
  margin: 0.35rem 0 0;
  font-size: 0.85rem;
  color: var(--muted, #64748b);
}

.detail__weighted-note {
  margin: 8px 0 0;
  padding: 0;
  font-size: 12px;
  font-weight: 500;
  line-height: 1.35;
  color: var(--ink-3);
  background: transparent;
  border: 0;
}

/* card footer */

.dish__foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-top: 5px;
  padding-top: 6px;
  border-top: 1px solid var(--line-2);
}

.linkish {
  border: 0;
  background: transparent;
  color: var(--teal);
  font-size: 12.5px;
  font-weight: 650;
  padding: 3px 0;
  cursor: pointer;
}

.linkish:hover { color: #0a5f59; text-decoration: underline; }

.btn-compare {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  border: 0;
  background: transparent;
  color: var(--ink-2);
  font-size: 12.5px;
  font-weight: 650;
  padding: 3px 0;
  cursor: pointer;
}

.btn-compare:hover { color: var(--ink); }

.dish__details { display: none; }

.dish.is-open .dish__details {
  display: block;
  margin-top: 9px;
  padding-top: 10px;
  border-top: 1px dashed var(--line);
  animation: rise .24s ease both;
}

/* состав и цены */

.detail__tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
  margin-bottom: 9px;
}

.dtab {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  border: 1px solid var(--line);
  background: #fff;
  border-radius: 999px;
  padding: 4px 10px 4px 8px;
  font-size: 11.5px;
  font-weight: 600;
  color: var(--ink-2);
  cursor: pointer;
  transition: border-color .15s ease, background .15s ease, color .15s ease;
}

.dtab b { font-weight: 750; color: var(--ink); }

.dtab:hover { border-color: #cfe4e2; background: #fbfefe; }

.dtab.is-on { background: var(--teal-soft); border-color: #b9dfda; color: #0a5f59; }

.dtab.is-on b { color: #0a5f59; }

.ilist { list-style: none; margin: 0; padding: 0; }

.iline {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  padding: 6px 2px;
  border-bottom: 1px dotted var(--line);
  font-size: 12.5px;
}

.iline:last-child { border-bottom: 0; }

.iline__main { min-width: 0; }

.iline__main b { font-weight: 650; }

.iline__main i { font-style: normal; color: var(--ink-2); margin-left: 5px; }

.iline__opt { font-size: 11px; color: var(--ink-3) !important; }

.iline__main em {
  display: block;
  font-style: normal;
  font-size: 11.5px;
  color: var(--ink-3);
  margin-top: 1px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.iline__cost { text-align: right; white-space: nowrap; }

.iline__cost b { display: block; font-weight: 700; }

.iline__cost i { font-style: normal; font-size: 11px; color: var(--ink-3); }

.totrow { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 9px; }

.tot {
  font-size: 11.5px;
  font-weight: 600;
  color: var(--ink-2);
  background: var(--cream);
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 4px 10px;
}

.tot b { font-weight: 750; color: var(--ink); }

.tot--per { background: var(--coral-soft); border-color: #ffd6c8; color: var(--coral-d); font-weight: 750; }

.tot--save { background: var(--save-soft); border-color: #c8e8d4; color: var(--save); font-weight: 750; }

.detail__addr { margin: 8px 0 0; font-size: 11.5px; color: var(--ink-3); }

.muted { color: var(--ink-3); font-weight: 500; }

.per { color: var(--coral-d); font-weight: 700; }

.save { color: var(--save); font-weight: 700; }

.instructions { margin-top: 10px; font-size: 12.5px; color: var(--ink-2); }

.instructions h3 {
  margin: 0 0 4px;
  font-size: 12px;
  font-weight: 750;
  text-transform: uppercase;
  letter-spacing: .06em;
  color: var(--ink-3);
}

/* ---------- basket sheet ---------- */

.sheet {
  border: 0;
  padding: 0;
  border-radius: 20px;
  max-width: 860px;
  width: calc(100% - 32px);
  box-shadow: 0 30px 80px rgba(20, 38, 63, .28);
  color: var(--ink);
}

.sheet::backdrop { background: rgba(20, 38, 63, .42); backdrop-filter: blur(2px); }

.sheet__inner { background: var(--card); border-radius: 20px; }

.sheet__head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 14px;
  padding: 18px 20px 12px;
  border-bottom: 1px solid var(--line-2);
}

.sheet__head h2 { margin: 0; font-size: 20px; font-weight: 800; letter-spacing: -.03em; }

.sheet__head p { margin: 3px 0 0; font-size: 12.5px; }

.sheet__body { padding: 14px 20px; max-height: 62vh; overflow: auto; }

.sheet__foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 20px 16px;
  border-top: 1px solid var(--line-2);
}

.basket-table { width: 100%; border-collapse: collapse; font-size: 12.5px; margin-top: 8px; table-layout: fixed; }

.basket-table th,
.basket-table td { border-bottom: 1px solid var(--line-2); padding: 8px 6px; text-align: left; vertical-align: top; word-break: break-word; }

.basket-table thead th {
  font-size: 10.5px;
  text-transform: uppercase;
  letter-spacing: .04em;
  color: var(--ink-3);
  background: var(--cream);
}

.basket-table th:nth-child(1),
.basket-table td:nth-child(1) { width: 34%; }

.basket-table th:nth-child(2),
.basket-table td:nth-child(2) { width: 18%; }

.basket-table th:nth-child(3),
.basket-table td:nth-child(3) { width: 12%; }

.basket-table th:nth-child(4),
.basket-table td:nth-child(4) { width: 16%; }

.basket-table th:nth-child(5),
.basket-table td:nth-child(5) { width: 20%; }

.price-old { text-decoration: line-through; color: var(--ink-3); margin-right: 6px; }

.price-now { font-weight: 700; }

.totals {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 12px;
}

.totals span {
  background: var(--cream);
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 6px 12px;
  font-size: 12.5px;
  font-weight: 650;
}

.totals .save { background: var(--save-soft); border-color: #c8e8d4; }

.totals .per { background: var(--coral-soft); border-color: #ffd6c8; }

.note-line { font-size: 11.5px; color: var(--ink-3); margin: 12px 0 0; }

.basket-scroll {
  width: 100%;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}

/* ---------- responsive ---------- */

@media (max-width: 1080px) {
  .studio { grid-template-columns: 1fr; }
  .studio__panel { border-right: 0; border-bottom: 1px solid var(--line-2); }
  .map { min-height: 240px; max-height: 48vh; }
}

@media (max-width: 760px) {
  body { font-size: 14.5px; overflow-x: hidden; }
  .app { padding: 14px 14px 40px; max-width: 100%; overflow-x: hidden; }
  .masthead { flex-wrap: wrap; gap: 10px; padding-bottom: 12px; }
  .brand { font-size: 21px; }
  .tagline { font-size: 12.5px; }
  .grid { grid-template-columns: 1fr; }
  .addr { flex-wrap: wrap; }
  .addr__input { min-width: 0; flex: 1 1 100%; }
  .btn--find { width: 100%; min-height: 44px; }
  .tuner__row { align-items: flex-start; flex-direction: column; gap: 5px; }
  .segmented {
    width: 100%;
    justify-content: stretch;
    flex-wrap: wrap;
    gap: 6px;
  }
  .segmented .seg {
    flex: 1 1 calc(50% - 6px);
    min-height: 40px;
    justify-content: center;
  }
  .excludes__head { flex-direction: column; align-items: flex-start; gap: 6px; }
  .excludes__picker select { max-width: none; width: 100%; }
  .real__toolbar { flex-direction: column; align-items: stretch; }
  .cta--feed { flex: none; width: 100%; min-height: 48px; }
  .real__addr { white-space: normal; }
  .dish__head { grid-template-columns: 42px 1fr; grid-template-areas: "tile ident" "cost cost"; }
  .tile { grid-area: tile; width: 42px; height: 42px; }
  .dish__ident { grid-area: ident; }
  .dish__cost {
    grid-area: cost;
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    text-align: left;
    margin-top: 8px;
    padding-top: 8px;
    border-top: 1px solid var(--line-2);
  }
  .shop { grid-template-columns: 8px minmax(0, 1fr) auto; gap: 2px 8px; }
  .shop__name { grid-column: 2; grid-row: 1; }
  .shop__mark { grid-column: 3; grid-row: 1; }
  .shop__walk { grid-column: 2; grid-row: 2; }
  .shop__price { grid-column: 3; grid-row: 2; text-align: right; }
  .mapbar__note { display: none; }
  .map { min-height: 200px; max-height: 38vh; }
  .is-start .hero { height: 230px; }
  .is-start .studio__map { order: -1; border-bottom: 1px solid var(--line-2); }
  .is-start .studio__panel { border-bottom: 0; }
  .sheet__body { max-height: 66vh; overflow-x: auto; }
  .basket-table {
    font-size: 12px;
    min-width: 520px;
    table-layout: auto;
  }
}

@media (max-width: 430px) {
  .app { padding: 12px 12px 36px; }
  .segmented .seg { font-size: 12.5px; padding-left: 8px; padding-right: 8px; }
  .real__summary { font-size: 13px; }
  .map { min-height: 190px; max-height: 36vh; }
}

@media (prefers-reduced-motion: reduce) {
  * { animation: none !important; transition: none !important; }
}
