.attribution-links { display: flex; align-items: center; gap: 15px; }

@media (max-width: 650px) {
  :root { --edge: 10px; }
  .product { grid-template-rows: auto minmax(340px, 1fr) auto; min-height: 100svh; height: 100svh; }
  .topbar { grid-area: 1 / 1; align-self: stretch; background: #f5f7fa; border-bottom: 1px solid var(--line); }
  .toolbar {
    grid-template-columns: 44px minmax(0,1fr) 44px;
    grid-template-areas: "brand search menu" "filters filters filters" "switch switch switch";
    gap: 5px;
    margin-top: 0;
    padding-block: 6px;
  }
  .brand { padding: 3px; width: 44px; min-height: 44px; border-radius: 10px; box-shadow: none; }
  .brand img { width: 36px; height: 36px; border-radius: 9px; }
  .brand span { display: none; }
  .menu-button { width: 44px; height: 44px; border-radius: 10px; box-shadow: none; }
  .search { min-height: 44px; border-radius: 10px; box-shadow: none; }
  .search-button { width: 39px; height: 42px; }
  .search input { min-height: 42px; }
  .filters, .switch { border-radius: 10px; box-shadow: none; }
  .filters { padding: 0; }
  .switch { padding: 0; gap: 0; }
  .switch button { border-radius: 9px; }
  .popover { top: 51px; }

  #map { grid-area: 2 / 1; }
  .map-area {
    display: grid;
    grid-template: minmax(0,1fr) auto auto / minmax(0,1fr) 132px;
    column-gap: 9px;
    padding-inline: var(--edge);
    background: #fff;
  }
  .map-area > .map-stage, .map-area > .map-stage.mo-cs {
    grid-area: 1 / 1 / 2 / -1;
    position: relative;
    inset: auto;
    width: auto;
    height: auto;
    min-height: 0;
    min-width: 0;
    margin-inline: calc(-1 * var(--edge));
    overflow: hidden;
    background: #edf1f1;
    border-bottom: 1px solid var(--line);
  }
  .map-area .map-value { display: none; }
  .map-area .legend {
    grid-area: 2 / 1 / 4 / 2;
    align-self: center;
    position: static;
    width: auto;
    min-width: 0;
    padding: 7px 0;
    border: 0;
    border-radius: 0;
    box-shadow: none;
  }
  .legend-head { gap: 5px; margin-bottom: 6px; }
  .legend-head p { font-size: 12px; }
  .legend-head svg { width: 14px; height: 14px; }
  .legend-scale { height: 7px; }
  .legend-labels { margin-top: 5px; font-size: 9px; gap: 3px; }
  .legend-extra { margin-top: 5px; }
  .has-report .map-tools, .map-area .map-tools {
    grid-area: 2 / 2 / 3 / 3;
    position: static;
    display: flex;
    align-self: start;
    width: 132px;
    margin-top: 2px;
    border: 0;
    border-radius: 8px;
    box-shadow: none;
  }
  .map-tools button { width: 44px; height: 44px; background: #f1f5fc; }
  .map-tools button + button { border-top: 0; border-left: 1px solid #dce5f5; }
  .has-report .competitors, .map-area .competitors {
    grid-area: 3 / 2 / 4 / 3;
    position: static;
    justify-content: center;
    min-height: 44px;
    width: 132px;
    padding-inline: 5px;
    border: 0;
    border-radius: 8px;
    box-shadow: none;
  }
  .map-frame .report { height: min(66svh, 600px); max-height: min(66svh, 600px); }

  .footer {
    grid-area: 3 / 1;
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    min-height: 0;
    gap: 0 7px;
    padding-block: 0;
  }
  .footer .sources-line { display: contents; }
  .footer .sources-line > .quiet-link { grid-area: 1 / 1; }
  .footer .contact-line { grid-area: 1 / 2; gap: 11px; }
  .footer .attribution-links { grid-area: 2 / 1 / 3 / -1; flex-wrap: wrap; gap: 0 8px; font-size: 10px; border-top: 1px solid var(--line); }
  .footer .quiet-link { font-size: 11px; }
  .footer .attribution-links a { min-height: 34px; }
}
